#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m;
vector<vector<int> > v(N);
vector<vector<int> > lang(N);
bool check(int s, int p) {
  int x = (s / 50) % 475;
  for (int j = 0; j < 25; j++) {
    x = (x * 96 + 42) % 475;
    if (26 + x == p) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int pp, x, y;
  cin >> pp >> x >> y;
  if (check(x, pp)) {
    cout << 0 << endl;
    return 0;
  } else {
    int temp = x;
    while (true) {
      temp -= 50;
      if (temp < y) break;
      if (check(temp, pp)) {
        cout << 0 << endl;
        return 0;
      }
    }
    int sucss = 0;
    while (true) {
      x += 50;
      sucss++;
      if (check(x, pp)) {
        break;
      }
    }
    cout << ceilf(sucss / 2.0) << endl;
  }
  return 0;
}
