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