#a = [ # [0,3,0,3,3], # [7,3,3,5,5], # [4,2,7,1,2], # [5,3,8,2,2], # [5,3,1,5,3] #] #b = [1290,4140,3520,4510,3320] # 1130 # 1110 # 1090 # 1020 # 1010 # 1000 # 920 # 910 # 900 # 780 # 940以上 n = int(input()) a = [7,78,1030,2910,222] print(a[n-1])