using System; using System.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { long n = long.Parse(Console.ReadLine()); long ans = 316 + 52 * (n - 1); Console.WriteLine(ans); } }