#include <bits/stdc++.h>
using namespace std;
int day1, day2, month1, month2, year1, year2;
int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int LeapYear(int);
int main() {
  scanf("%d:%d:%d", &year1, &month1, &day1);
  scanf("%d:%d:%d", &year2, &month2, &day2);
  int sum1 = year1 * 10000 + month1 * 100 + day1;
  int sum2 = year2 * 10000 + month2 * 100 + day2;
  if (sum1 > sum2) {
    swap(year1, year2);
    swap(month1, month2);
    swap(day1, day2);
  }
  int res = 0;
  if (year1 != year2) {
    for (int i = year1 + 1; i <= year2 - 1; i++) {
      res += 365 + LeapYear(i);
    }
    for (int i = month1 + 1; i <= 12; i++) res += month[i];
    for (int i = 1; i <= month2 - 1; i++) res += month[i];
    res += day2;
    res += (month[month1] - day1 + 1);
    if (month1 <= 2) res += LeapYear(year1);
    if (month2 > 2) res += LeapYear(year2);
    cout << res - 1;
  } else if (year1 == year2) {
    if (month1 == month2) {
      cout << day2 - day1;
    } else {
      for (int i = month1; i <= month2 - 1; i++) res += month[i];
      res += day2;
      res -= day1;
      if (month1 <= 2 && month2 > 2) res += LeapYear(year1);
      cout << res;
    }
  }
  return 0;
}
int LeapYear(int year) {
  if ((year % 100 != 0 && year % 4 == 0) || year % 400 == 0)
    return 1;
  else
    return 0;
}
