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