import java.util.Scanner; class no299{ public static void main(String[] args) { Scanner stdIn=new Scanner(System.in); long n=stdIn.nextLong(); System.out.println(316+52*(n-1)); } }