#include <bits/stdc++.h>
using namespace std;
int main() {
  int p, x, y, ans = 0, ans2 = 0, z = 0;
  bool d = false;
  cin >> p >> x >> y;
  for (int i = 0; i < 30000; i++) {
    int s = x + z;
    int h = (s / 50) % 475;
    vector<int> v(501, 0);
    for (int j = 1; j <= 25; j++) {
      h = (h * 96 + 42) % 475;
      v[h + 26]++;
    }
    if (v[p] == 1) {
      z % 100 ? ans = z / 100 + 1 : ans = z / 100;
      break;
    }
    z += 50;
    v.clear();
  }
  while (x > y) {
    x -= 50;
    if (x < y) {
      break;
    }
    int s = x;
    int h = (s / 50) % 475;
    vector<int> v(501, 0);
    for (int j = 1; j <= 25; j++) {
      h = (h * 96 + 42) % 475;
      v[h + 26]++;
    }
    if (v[p] == 1) {
      d = true;
    }
    v.clear();
  }
  if (d) {
    cout << 0;
    return 0;
  }
  ans == 0 ? cout << 0 : cout << ans;
  return 0;
}
