n = int(input()) a = [7,143,1020,3169,222] print(a[n-1])