#include <bits/stdc++.h>
using namespace std;
int GLL(long long& x) { return scanf("%lld", &x); }
int GI(int& x) { return scanf("%d", &x); }
int p, x, y;
bool test(int s) {
  int i = (s / 50) % 475;
  set<int> out;
  for (int j = 0; j < (int)(25); j++) {
    i = (i * 96 + 42) % 475;
    out.insert(i);
  }
  return (out.find(p) != out.end());
}
int main() {
  GI(p);
  GI(x);
  GI(y);
  p -= 26;
  int i = p;
  vector<int> scores;
  vector<int> diff;
  int score = x;
  int ans = 2000000000;
  while (score >= y) {
    if (test(score)) {
      ans = 0;
    }
    score -= 50;
  }
  if (ans > 0) {
    score = 0;
    int cnt = 0;
    while (true) {
      if (test(x + score)) {
        ans = min(ans, cnt);
        break;
      }
      score += 50;
      cnt = (score + 99) / 100;
    }
  }
  printf("%d\n", ans);
  return 0;
}
