#include <bits/stdc++.h>
using namespace std;
int rat, score, need;
int low, high;
int main() {
  cin >> rat >> score >> need;
  int s;
  int i;
  for (s = score; s >= need; s -= 50) {
    i = (s / 50) % 475;
    for (int j = 0; j < 25; j++) {
      i = (i * 96 + 42) % 475;
      if (26 + i == rat) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  int cnt = 0;
  for (s = score;;) {
    i = (s / 50) % 475;
    for (int j = 0; j < 25; j++) {
      i = (i * 96 + 42) % 475;
      if (26 + i == rat) {
        cout << ((s - score) % 100 == 0 ? cnt / 2 : cnt / 2 + 1) << endl;
        return 0;
      }
    }
    cnt += 1;
    s += 50;
  }
  return 0;
}
