#include <bits/stdc++.h>
int main() {
  int n, b, c, count = 0;
  double a;
  scanf("%d", &n);
  for (c = 5; c <= n; c++) {
    for (b = 1; b < c; b++) {
      a = sqrt(c * c - b * b);
      if ((a - (int)a) == 0 && a <= b) count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
