#include <iostream>
using namespace std;
int a[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int main() {
    int time = 0;
    int temp1, temp2;
    scanf("%d", &temp1);
    scanf("%d", &temp2);
    int day1, day2, mon1, mon2, year1, year2;
    day1 = temp1 % 100;
    int i = temp1 / 100;
    day2 = temp2 % 100;
    int j = temp2 / 100;
    mon1 = i % 100;
    mon2 = j % 100;
    year1 = i / 100;
    year2 = j / 100;
    while (day1 != day2) {
        time += day2 - day1;
    }
    while (mon1 != mon2) { //二大一小
        if (mon1 > mon2) {
            time += a[mon2++];
        } else time += a[mon1++];
    }
    while (year1 != year2) {
        if (year1 > year2) {
            if (year2 % 4 == 0 && year2 % 100 != 0 || year2 % 400 == 0) {
                time += 366;
            } else time += 365;
            year2++;
        } else if (year1 < year2) {
            if (year1 % 4 == 0 && year1 % 100 != 0 || year1 % 400 == 0) {
                time += 366;
            } else time += 365;
            year1++;
        }
    }
    time = time + 1;
    printf("%d", time);
    return 0;
}