#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long int i, j, x, y, n, m, cnt = 0, k, g, flg, t, p, strt;
  cin >> p >> x >> y;
  strt = x;
  while (strt - 50 >= y) strt -= 50;
  while (1) {
    m = strt;
    m /= 50;
    m %= 475;
    for (i = 1; i <= 25; i++) {
      m = (m * 96 + 42) % 475;
      if (m + 26 == p) {
        cnt = 1;
        break;
      }
    }
    if (cnt) break;
    strt += 50;
  }
  if (strt <= x) {
    cout << 0;
  } else {
    m = strt - x;
    cnt = m / 100;
    m %= 100;
    if (m) cnt++;
    cout << cnt;
  }
}
