#include <bits/stdc++.h>
using namespace std;
int p, x, y;
bool win(int i) {
  for (int j = 0; j != 25; j++) {
    i = (i * 96 + 42) % 475;
    i += 475;
    i %= 475;
    if (i + 26 == p) {
      return true;
    }
  }
  return false;
}
int main() {
  cin >> p >> x >> y;
  int i = (x / 50) % 475;
  for (int curr_score = x; curr_score >= y; curr_score -= 50) {
    if (win((curr_score / 50) % 475)) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int curr_score = x;; curr_score += 50) {
    if (win((curr_score / 50) % 475)) {
      cout << (curr_score + 50 - x) / 100 << endl;
      return 0;
    }
  }
}
