#include<iostream>
using namespace std;
int nums[100][100] = {0};
int main()
{
int i = 0, j = 0;
int n = 1;
nums[i][j] = n++;
while(i<50&&j< 50){
if(i == 0){
nums[i][++j] = n++;
while(j>0){
nums[++i][--j] = n++;
}
}
if(j == 0){
nums[++i][j] = n++;
while(i>0){
nums[--i][++j] = n++;
}
}
}
cout<<nums[19][19]<<endl;
return 0;
}