#include <bits/stdc++.h>
using namespace std;
vector<int> check[500 + 1];
int main() {
  int p, x, y;
  int n = 0;
  int supposed_i = 0;
  cin >> p >> x >> y;
  for (int i = 0; i < 475; ++i) {
    int tmp_i = i;
    for (int j = 0; j < 25; ++j) {
      tmp_i = (tmp_i * 96 + 42) % 475;
      check[26 + tmp_i].push_back(i);
    }
  }
  for (n = 0; n < check[p].size() - 1; ++n)
    if (check[p][n] * 50 <= x && check[p][n + 1] * 50 > x) break;
  if (x < check[p][0] * 50)
    cout << (check[p][0] * 50 + 99 - x) / 100 << endl;
  else if (x - check[p][n] * 50 < 50)
    cout << 0 << endl;
  else if (y < check[p][n] * 50 + 50 &&
           (x - y) % 50 <= (check[p][n] * 50 + 50 - y) && (x - y) >= 50)
    cout << 0 << endl;
  else if (check[p][n] * 50 < y)
    cout << (check[p][n + 1] * 50 + 99 - x) / 100 << endl;
  else
    cout << 0 << endl;
  return 0;
}
