import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No299 { public static void main(String[] args) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long ver = Long.parseLong(br.readLine()); System.out.println(pageNum(ver)); }catch(IOException e){ e.getStackTrace(); }catch(NumberFormatException e){ e.getStackTrace(); } } public static long pageNum(long x){ long page = 0; page = 316 + ( x -1 ) * 52; return page; } }