#include <bits/stdc++.h>
using namespace std;
int main() {
  int j = 0, x, y, p, k = 0, bo = 0, x1 = 0, m = 0, x2 = 0;
  cin >> p >> x >> y;
  x1 = x;
  x2 = x;
  while (x2 >= y) {
    j = ((x2 / 50) % 475);
    for (int i = 1; i <= 25; i++) {
      j = ((j * 96 + 42) % 475);
      if ((j + 26) == p) {
        bo = 1;
        break;
      }
    }
    if (bo == 1) {
      cout << 0;
      return 0;
    }
    x2 -= 50;
  }
  while (x <= 20000) {
    j = ((x / 50) % 475);
    for (int i = 1; i <= 25; i++) {
      j = ((j * 96 + 42) % 475);
      if ((j + 26) == p) {
        bo = 1;
        break;
      }
    }
    if (bo == 1) {
      if (k % 100 != 0)
        cout << (k / 100) + 1;
      else
        cout << (k / 100);
      return 0;
    }
    k += 50;
    x += 50;
  }
  j = k = 0;
  while (1) {
    x1 -= 50;
    j = 0;
    k -= 50;
    j = ((x1 / 50) % 475);
    for (int i = 1; i <= 25; i++) {
      j = ((j * 96 + 42) % 475);
      if ((j + 26) == p) {
        bo = 1;
        break;
      }
    }
    if (bo == 1) {
      if (k % 100 != 0)
        cout << (k / 100) + 1;
      else
        cout << (k / 100);
      return 0;
    }
    x1 += 100;
    k += 100;
    j = 0;
    j = ((x1 / 50) % 475);
    for (int i = 1; i <= 25; i++) {
      j = ((j * 96 + 42) % 475);
      if ((j + 26) == p) {
        bo = 1;
        break;
      }
    }
    if (bo == 1) {
      if (k % 100 != 0)
        cout << (k / 100) + 1;
      else
        cout << (k / 100);
      return 0;
    }
  }
  return 0;
}
