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