#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const double _eps = 1e-5;
int x, y, p, s;
int main() {
  cin >> p >> x >> y;
  for (int j = (y - x) / 50; j <= 251000; ++j) {
    s = x + 50 * j;
    int i = (s / 50) % 475;
    for (int k = 1; k <= 25; ++k) {
      i = (i * 96 + 42) % 475;
      if (i + 26 == p && j <= 0) {
        cout << 0;
        return 0;
      }
      if (i + 26 == p) {
        cout << ((j * 50) % 100 == 50 ? j / 2 + 1 : j / 2);
        return 0;
      }
    }
  }
}
