#include <bits/stdc++.h>
using namespace std;
bool contain(int s, int place) {
  int i = (s / 50) % 475;
  for (int k = 0; k < 25; k++) {
    i = (i * 96 + 42) % 475;
    if (26 + i == place) {
      return true;
    }
  }
  return false;
}
int main() {
  int place, score1, score2;
  scanf("%d %d %d", &place, &score1, &score2);
  int lucky_min = 0;
  if (score2 > score1) lucky_min = (score2 - score1 + 99) / 100;
  int cur_score = score1 + lucky_min * 100;
  int cnt__50 = 1;
  while (cur_score - cnt__50 * 50 >= score2) {
    if (contain(cur_score - cnt__50 * 50, place)) {
      cout << lucky_min << endl;
      return 0;
    }
    cnt__50++;
  }
  int cnt_50 = 0;
  while (true) {
    if (contain(cur_score + 50 * cnt_50, place)) {
      cout << lucky_min + (cnt_50 + 1) / 2 << endl;
      return 0;
    }
    cnt_50++;
  }
  return 0;
}
