import java.io.*; import java.util.*; class Main299 { public static void out (Object o) { System.out.println(o); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); out(316 + 52 * (n - 1)); } }