#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  int ans = 0;
  for (int b = 1; b <= n; ++b)
    for (int a = b; a >= 1; --a) {
      int c = b * b - a * a, sc = sqrt(c);
      if (sc * sc == c && a <= sc && sc <= b) ++ans;
    }
  cout << ans << endl;
  return 0;
}
