#include <bits/stdc++.h>
using namespace std;
int date1[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int date2[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool check(int year) {
  if (year % 400 == 0) return 1;
  if (year % 4 == 0 && year % 100 != 0) return 1;
  return 0;
}
int main() {
  int sy, sm, sd, ty, tm, td;
  scanf("%d:%d:%d", &sy, &sm, &sd);
  scanf("%d:%d:%d", &ty, &tm, &td);
  int s = 0;
  if (!(sy < ty || sy == ty && sm < tm || sy == ty && sm == tm && sd < td)) {
    swap(sy, ty);
    swap(sm, tm);
    swap(sd, td);
  }
  if (sy == ty) {
    int a = 0, b = 0;
    if (check(sy)) {
      for (int i = 1; i < sm; i++) a += date2[i];
      a += sd - 1;
      for (int i = 1; i < tm; i++) b += date2[i];
      b += td - 1;
      printf("%d\n", b - a);
    } else {
      for (int i = 1; i < sm; i++) a += date1[i];
      a += sd - 1;
      for (int i = 1; i < tm; i++) b += date1[i];
      b += td - 1;
      printf("%d\n", b - a);
    }
    return 0;
  }
  for (int i = sy + 1; i < ty; i++) {
    if (check(i))
      s += 366;
    else
      s += 365;
  }
  if (check(sy)) {
    int tmp = 0;
    for (int i = 1; i < sm; i++) tmp += date2[i];
    tmp += sd - 1;
    s += 366 - tmp;
  } else {
    int tmp = 0;
    for (int i = 1; i < sm; i++) tmp += date1[i];
    tmp += sd - 1;
    s += 365 - tmp;
  }
  if (check(ty)) {
    int tmp = 0;
    for (int i = 1; i < tm; i++) tmp += date2[i];
    tmp += td - 1;
    s += tmp;
  } else {
    int tmp = 0;
    for (int i = 1; i < tm; i++) tmp += date1[i];
    tmp += td - 1;
    s += tmp;
  }
  printf("%d\n", s);
  return 0;
}
