n = int(input()) page = 316 + (n-1)*52 print(int(page))