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; line=sc.nextLine(); long result=316+52*(Long.parseLong(line)-1); System.out.println(result); } }