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