import java.util.Scanner object Yukicoder { def main(args: Array[String]): Unit = { var in = new Scanner(System.in) print(316 + 52 * (in.nextInt() - 1)) } }