#include long int main(){ int n; scanf("%d",&n); printf("%ld",312 + 52*(n-1)); return 0; }