problem 22 input data
answer 22 in python