#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int a = 1; a < 10001; a++) {
    for (int b = 1; b < 10001; b++) {
      if (a * a + b * b <= n * n) {
        int srt = sqrt(a * a + b * b);
        if (srt * srt == a * a + b * b) cnt++;
      } else
        break;
    }
  }
  cout << cnt / 2 << endl;
}
