import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! Scanner sc=new Scanner(System.in); String[] line; String result=""; line=sc.nextLine().split(" "); result+=316+52*(Long.parseLong(line[0])-1); System.out.println(result); } }