#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int p, X, y;
  cin >> p >> X >> y;
  int ans = 1e9;
  int f = 0;
  for (int x = y; x <= 1e6; x++) {
    int temp = x / 50;
    temp %= 475;
    for (int i = 1; i <= 25; i++) {
      temp = (temp * 96 + 42) % 475;
      if (26 + temp == p) {
        if (x <= X) {
          if (abs(x - X) % 50 == 0) {
            cout << 0;
            return 0;
          }
        } else {
          int val = abs(x - X);
          if (val % 50 == 0) {
            int vv = val / 100;
            if (val % 100 != 0) vv++;
            ans = min(ans, vv);
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
