#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int nmax = 1000100;
long long res, cnt = 1e+9 + 7;
long long p, x, y, a, b, c;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> p >> x >> y;
  while (1 != 0) {
    a = (y / 50) % 475;
    for (int i = 0; i < 25; ++i) {
      a = (a * 96 + 42) % 475;
      if (26 + a == p && abs(x - y) % 50 == 0) break;
    }
    if (26 + a == p && abs(x - y) % 50 == 0) break;
    ++y;
  }
  if (y <= x) {
    cout << 0 << endl;
    return 0;
  }
  swap(x, y);
  c = (x - y) / 100 + min(((x - y) % 100), (long long)1);
  cout << c << endl;
  return 0;
}
