#include <bits/stdc++.h>
using namespace std;
long long int b_array[1000002];
int main() {
  std::ios_base::sync_with_stdio(0);
  long long int i, j, k, l, m, n, c, sum, count_a, s, f, p, x, y, temp, temp2,
      cc, dd, d;
  cc = -30000;
  int a[1002], b[1002];
  cin >> p >> x >> y;
  temp = 0;
  d = y;
  c = x / 50;
  c = c * 50;
  while ((c >= d) || (c == 0 && y == 1)) {
    i = (c / 50) % 475;
    for (j = 0; j < 25; j++) {
      i = (i * 96 + 42) % 475;
      i = i + 26;
      if (i == p) {
        temp = 1;
        break;
      }
      i = i - 26;
    }
    if (temp == 1) break;
    c = c - 50;
  }
  if (temp == 0) {
    temp = 0;
    d = y / 50;
    d = d * 50;
    c = x / 50;
    c = c * 50;
    while (c >= d) {
      i = (c / 50) % 475;
      for (j = 0; j < 25; j++) {
        i = (i * 96 + 42) % 475;
        i = i + 26;
        if (i == p) {
          temp = 1;
          break;
        }
        i = i - 26;
      }
      if (temp == 1) break;
      c = c + 50;
    }
  } else if (temp == 1) {
    temp2 = 0;
    dd = y / 50;
    dd = dd * 50;
    cc = x / 50;
    cc = cc * 50;
    while (cc >= dd) {
      i = (cc / 50) % 475;
      for (j = 0; j < 25; j++) {
        i = (i * 96 + 42) % 475;
        i = i + 26;
        if (i == p) {
          temp2 = 1;
          break;
        }
        i = i - 26;
      }
      if (temp2 == 1) break;
      cc = cc + 50;
    }
  }
  if (cc == -30000) {
    int l = x % 50;
    if (c >= x) {
      c = c + l;
      c = c - x;
      if (c % 50 == 0 && c % 100 != 0) {
        c = c / 100;
        c = c + 1;
        cout << c;
      } else {
        c = c / 100;
        cout << c;
      }
    } else {
      c = c + l;
      c = x - c;
      if (c % 50 == 0) {
        cout << "0";
      }
    }
  } else {
    int ll = x % 50;
    c = c + ll;
    c = x - c;
    cc = cc + ll;
    cc = cc - x;
    if (cc >= c || temp == 1) {
      if (c % 50 == 0) {
        cout << "0";
      }
    } else {
      c = cc;
      if (c % 50 == 0 && c % 100 != 0) {
        c = c / 100;
        c = c + 1;
        cout << c;
      } else {
        c = c / 100;
        cout << c;
      }
    }
  }
  return 0;
}
