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