#include <bits/stdc++.h>
using namespace std;
int p, x, y;
bool check(int s) {
  int x = s / 50 % 475;
  for (int i = 1; i <= 25; i++) {
    x = (x * 96 + 42) % 475;
    if (x + 26 == p) return true;
  }
  return false;
}
int main() {
  cin >> p >> x >> y;
  for (int i = 0;; i++) {
    int j = 0;
    while (true) {
      int s = x + 100 * i - 50 * j;
      if (s < y) break;
      if (check(s)) {
        cout << i << endl;
        return 0;
      }
      j++;
    }
  }
}
