#include <iostream>
#include <string>
using namespace std;
class Date {
public:
Date(string& s) {
_year = stoi(s.substr(0, 4));
_month = stoi(s.substr(4, 2));
_day = stoi(s.substr(6));
}
bool operator<(const Date& d) const {
if (_year < d._year) {
return true;
}
else if (_year == d._year && _month < d._month) {
return true;
}
else if (_year == d._year && _month == d._month && _day < d._day) {
return true;
}
else {
return false;
}
}
bool operator!=(const Date& d) const {
return (_year != d._year) || (_month != d._month) || (_day != d._day);
}
int GetMonthDay(int year, int month) const {
static int monthDayArr[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int day = monthDayArr[month];
if (month == 2 && ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))) {
day += 1;
}
return day;
}
Date& operator+=(int day) {
_day += day;
while (_day > GetMonthDay(_year, _month)) {
_day -= GetMonthDay(_year, _month);
_month++;
if (_month == 13) {
_year++;
_month = 1;
}
}
return *this;
}
Date& operator++() {
*this += 1;
return *this;
}
int operator-(const Date& d) const {
Date max = *this, min = d;
if (*this < d) {
max = d, min = *this;
}
int cnt = 0;
while (min != max) {
++min;
++cnt;
}
return cnt + 1;
}
private:
int _year;
int _month;
int _day;
};
int main()
{
string a, b;
cin >> a >> b;
Date d1(a);
Date d2(b);
cout << (d1 - d2) << endl;
return 0;
}