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