import java.util.Scanner; class main{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); System.out.printf("%d\n", 316 + 52 * (N - 1)); } }