#include <bits/stdc++.h>
using namespace std;
const int md = 475;
int dx[8] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[8] = {0, 0, -1, 1, 1, -1, -1, 1};
int p, x, y;
int main() {
  scanf("%d%d%d", &p, &x, &y);
  int mn = 1e9;
  for (int s = y; s < 100006; s++) {
    int i = (s / 50) % md;
    int pp = i;
    for (int j = 0; j < 25; j++) {
      pp = ((pp * 96) + 42) % md;
      if ((pp + 26) == p) {
        int pro = s;
        if (pro >= y) {
          int dif = abs(x - s);
          if (dif % 100 == 0 || (dif - 50) % 100 == 0) {
            if (pro <= x) {
              puts("0");
              return 0;
            } else {
              mn = min(mn, (dif % 100 != 0) + (dif / 100));
              cout << mn << endl;
              return 0;
            }
          }
        }
      }
    }
  }
  return 0;
}
