# Write a program that asks for two integers
# The first represents the number of chickens the farmer has
# The seconf represents the number of pigs the farmer has
# It should print how many legs all the animals have

print ("Dear farmer, please add the number of chickens you have:")
ch = int(input())
print ("And now please add the number of pigs you have:")
p =  int(input())

print ("The total number of legs all the animals have is: ", ch*2+p*4)
