#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int N = 100005;
int n, m, i, j, k, q, s, v, w, ans;
int p, x, y;
bool check(int s) {
  set<int> st;
  int ind = (s / 50) % 475;
  for (int i = 1; i <= 25; i++) {
    ind = (ind * 96 + 42) % 475;
    st.insert(26 + ind);
  }
  return (st.find(p) != st.end());
}
int main() {
  cin >> p >> x >> y;
  int xx = x;
  if (check(x)) {
    cout << 0 << endl;
    return 0;
  }
  while (x - 50 >= y) {
    x -= 50;
    if (check(x)) {
      cout << 0 << endl;
      return 0;
    }
  }
  x = xx;
  while (x <= y) {
    x += 100;
    ans++;
  }
  while (1) {
    if (x - 50 >= y && check(x - 50) || check(x)) {
      cout << ans << endl;
      return 0;
    }
    ans++;
    x += 100;
  }
  return 0;
}
