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