#include <bits/stdc++.h>
using namespace std;
bool isLeap(int year) {
  if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
    return true;
  else
    return false;
}
int main() {
  int year1, year2, month1, month2, day1, day2, ans = 0;
  int mo[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  scanf("%d:%d:%d", &year1, &month1, &day1);
  scanf("%d:%d:%d", &year2, &month2, &day2);
  if (year1 > year2) {
    swap(year1, year2);
    swap(month1, month2);
    swap(day1, day2);
  }
  if (year1 == year2) {
    if (month1 > month2) {
      swap(month1, month2);
      swap(day1, day2);
    }
    if (month1 == month2)
      ans += max(day1, day2) - min(day1, day2);
    else {
      for (int i = month1; i <= month2; i++) {
        if (i == month2)
          ans += day2;
        else if (i == month1)
          ans += isLeap(year1) && i == 2 ? 29 - day1 : mo[i] - day1;
        else
          ans += isLeap(year1) && i == 2 ? 29 : mo[i];
      }
    }
  } else {
    ans += isLeap(year1) && month1 == 2 ? 29 - day1 : mo[month1] - day1;
    ans += day2;
    for (int i = month1 + 1; i <= 12; i++)
      ans += isLeap(year1) && i == 2 ? 29 : mo[i];
    for (int i = 1; i <= month2 - 1; i++)
      ans += isLeap(year2) && i == 2 ? 29 : mo[i];
    for (int i = year1 + 1; i <= year2 - 1; i++) ans += isLeap(i) ? 366 : 365;
  }
  printf("%d\n", ans);
}
