#include <bits/stdc++.h>
using namespace std;
const int N = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int p, x, y;
  cin >> p >> x >> y;
  vector<bool> arr(20001);
  int mn = INT_MAX;
  int start = x - ((x - y) / 50) * 50;
  for (int curr = start;; curr += 50) {
    bool flag = false;
    int i = (curr / 50) % 475;
    for (int j = 0; j < 25; j++) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p) {
        flag = true;
        break;
      }
    }
    if (flag) {
      if (curr <= x) {
        cout << 0;
      } else {
        cout << ((curr + 50) - x) / 100;
      }
      return 0;
    }
  }
  return 0;
}
