import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;

int p;

bool ok(int s) {
    int i = s / 50 % 475;
    foreach (_; 0..25) {
        i = (i * 96 + 42) % 475;
        if (26 + i == p) return true;
    }
    return false;
}

void main() {
    auto s = readln.split.map!(to!int);
    p = s[0];
    int x = s[1];
    int y = s[2];
    int ox = x;
    while (x - 50 >= y) x -= 50;
    while (!ok(x)) x += 50;
    writeln(max(0, (x - ox + 50) / 100));
}
