import * as fs from 'fs'; const input = fs.readFileSync('/dev/stdin', 'utf8'); let N = parseInt(input); console.log(316 + 52 *(N - 1));