#include <bits/stdc++.h>
using namespace std;
struct date {
  int dd, mm, yy;
};
int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int Lmonth[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int year = 365;
int leapyear = 366;
bool leap(int yy) {
  if (yy % 400 == 0) return true;
  if (yy % 100 == 0) return false;
  if (yy % 4 == 0) return true;
  return false;
}
int main() {
  date A, B;
  scanf("%d:%d:%d", &A.yy, &A.mm, &A.dd);
  scanf("%d:%d:%d", &B.yy, &B.mm, &B.dd);
  if (A.yy > B.yy)
    swap(A, B);
  else if (A.yy == B.yy && A.mm > B.mm)
    swap(A, B);
  else if (A.mm == B.mm && A.yy == B.yy && A.dd > B.dd)
    swap(A, B);
  int days = 0;
  for (int i = A.yy; i < B.yy; i++) {
    if (leap(i)) {
      days += leapyear;
    } else
      days += year;
  }
  int leftadj = 0;
  for (int i = 1; i < A.mm; i++) {
    if (leap(A.yy))
      leftadj += Lmonth[i];
    else
      leftadj += month[i];
  }
  leftadj += A.dd;
  int rightadj = 0;
  for (int i = 1; i < B.mm; i++) {
    if (leap(B.yy))
      rightadj += Lmonth[i];
    else
      rightadj += month[i];
  }
  rightadj += B.dd;
  days += rightadj - leftadj;
  cout << days << endl;
  return 0;
}
