import java.util.Scanner; class AntBook { long page; void setPage(long ver) { this.page = 316 + (ver - 1) * 52; } } public class No_299 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); AntBook ab = new AntBook(); ab.setPage(sc.nextLong()); System.out.println(ab.page); sc.close(); } }