import java.util.*; public class pre { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); System.out.println((316 + 52 * (n-1))); } }