I don't understand how to write both. If I repeat the first code but with 3 and 6 it doesn't work.
Thank you.

It looks like you need to get both numbers from the input. Try doing something like this:
print(int(input()) + int(input()))