m = float (raw_input('Enter the value of m:'))
n = float (raw_input('Enter the value of n:'))

def ackermann(m, n):
    if m == 0:
        return n + 1
    elif m >= 0 and n == 0:
        return ackermann(m-1, 1)
    elif m >= 0 and n >= 0:
        return ackermann(m-1, ackermann(m, n-1))
print ackermann(m, n)
