N = raw_input() assert 1 <= N <= 10 ** 10 print 316 + 52 * (N - 1)