# -*- coding: utf-8 -*- N = input() N1 = 316 N2 = 368 delP = N2 - N1 print N1 + (N-1) * delP