#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, a, b, c, x, n, k, t22, t1, t2, t4, y, t;
  float f, t3;
  vector<int> g1;
  cin >> n;
  x = 0;
  for (j = 2; j <= n; j++) {
    t1 = j * j;
    for (k = 2; k < j; k++) {
      t2 = k * k;
      t3 = t1 - t2;
      f = sqrt(t3);
      if (f - (int)f == 0) {
        t22 = k;
        g1.push_back(t22);
      }
    }
  }
  x = g1.size();
  x = x / 2;
  cout << x << endl;
}
