import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { BigInteger count = new BigInteger(Integer.parseInt(buff.readLine())-1 + ""); BigInteger ans = new BigInteger("316"); ans = ans.add(count.multiply(new BigInteger("52"))); System.out.println(ans.toString()); } catch (NumberFormatException e) { e.getStackTrace(); } catch (IOException e) { e.getStackTrace(); } catch (Exception e) { e.getStackTrace(); } } }