#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, m;
char s[N];
int p, x, y;
int main() {
  cin >> p >> x >> y;
  int ans = 0;
  int xx = x;
  while (x - 50 >= y) x -= 50;
  int l = x / 50;
  for (int i = 1; i <= 25; i++) {
    l = (l * 96 + 42) % 475;
    if (l + 26 == p) {
      cout << 0 << endl;
      return 0;
    }
  }
  y = x;
  x = xx;
  for (int t = 0; t <= 475; t++) {
    int l = y / 50;
    for (int i = 1; i <= 25; i++) {
      l = (l * 96 + 42) % 475;
      if ((l + 26) == p) {
        if (y <= x)
          cout << 0 << endl;
        else
          cout << max(0, (y - x + 99) / 100) << endl;
        return 0;
      }
    }
    y += 50;
  }
  return 0;
}
