#include <bits/stdc++.h>
using namespace std;
int fromy, fromm, fromd, toy, tom, tod;
int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool isleap(int x) {
  if (x % 400 == 0 || (x % 4 == 0 && x % 100)) return true;
  return false;
}
int main() {
  while (scanf("%d:%d:%d", &fromy, &fromm, &fromd) != EOF) {
    scanf("%d:%d:%d", &toy, &tom, &tod);
    if (toy < fromy || toy == fromy && tom < fromm ||
        toy == fromy && tom == fromm && tod < tom) {
      swap(fromy, toy);
      swap(fromd, tod);
      swap(fromm, tom);
    }
    int ans = 0;
    int y = fromy, m = fromm, d = fromd;
    while (y != toy || m != tom || d != tod) {
      ans++;
      int total = month[m];
      if (m == 2 && isleap(y)) total++;
      if (d + 1 > total) {
        d = 1;
        m++;
      } else
        d++;
      if (m > 12) {
        m = 1;
        y++;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
