#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] # 990 + 100 * いくつか n = int(input()) a = [7,78,1110,2910,222] print(a[n-1])