#include <iostream>
#include <map>
#include <cmath>
using namespace std;
int main() {
count << n;
map<int,int> counters;
for (int x = 1; x < n; ++x)
for (int y = 1; y < x; ++y)
{
long long s = (long long)x * x + (long long)y * y;
long long r = sqrt(s);
if (r*r == s)
{
counters[r] += 1;
}
}
int maxCount = 0, maxR = 0;
for (map<int,int>::iterator it=counters.begin(); it!=counters.end(); ++it)
{
if (it->second > maxCount)
{
maxCount = it->second;
maxR = it->first;
}
}
cout << maxR;
return 0;
}