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