#include <iostream>
using namespace std;
bool isLeapyear(int year){
    if((!(year % 4) && (year % 100 != 0)) || year%400 == 0 ) return true;
    return false;
}
int dm[2][13] = {
        {0, 31, 28, 31, 30, 31, 30, 31, 31 ,30, 31, 30, 31},
        {0, 31, 29, 31, 30, 31, 30, 31, 31 ,30, 31, 30, 31}
};
int main()
    int y1, y2, m1, m2, d1, d2, res;
    int q1, q2;
    cin >> q1 >> q2;
    y1 = q1 / 10000; m1 = q1 / 100 % 100; d1 = q1 % 100;
    y2 = q2 / 10000; m2 = q2 / 100 % 100; d2 = q2 % 100;
    int dy = y2-y1;
    int di1 = 0; int di2 = 0;
    int row = isLeapyear(y1);
    for(int i = 0; i < m1; i++){
        di1 += dm[row][i];
    }
    di1 += d1;
    row = isLeapyear(y2);
    for(int i = 0; i < m2; i++){
        di2 += dm[row][i];
    }
    di2 += d2;
    int dd = di2 - di1 + 1;
    for(int i = y1; i < y2; i++){
        dd += isLeapyear(i) + 365;
    }
    printf("%d\n", dd);
    return 0;
}