#include <bits/stdc++.h>
using namespace std;
int main() {
  int s[105], i;
  int nian1, nian2, yue1, yue2, ri1, ri2;
  int run[14] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int nun[14] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  while (scanf("%d:%d:%d", &nian1, &yue1, &ri1) != EOF) {
    scanf("%d:%d:%d", &nian2, &yue2, &ri2);
    int t1 = 0, t2 = 0, t3 = 0;
    if (nian1 > nian2) {
      t1 = nian1;
      nian1 = nian2;
      nian2 = t1;
      t2 = yue1;
      yue1 = yue2;
      yue2 = t2;
      t3 = ri1;
      ri1 = ri2;
      ri2 = t3;
    }
    if (nian1 == nian2 && yue1 > yue2) {
      int tt1 = 0, tt2 = 0;
      tt1 = yue1;
      yue1 = yue2;
      yue2 = tt1;
      tt2 = ri1;
      ri1 = ri2;
      ri2 = tt2;
    }
    if (nian1 == nian2 && yue1 == yue2 && ri1 > ri2) {
      int ttt = 0;
      ttt = ri1;
      ri1 = ri2;
      ri2 = ttt;
    }
    int sum = 0;
    int k = 0;
    int flag1 = 0;
    int flag2 = 0;
    if ((nian1 % 4 == 0 && nian1 % 100 != 0) || nian1 % 400 == 0) flag1 = 1;
    if ((nian2 % 4 == 0 && nian2 % 100 != 0) || nian2 % 400 == 0) flag2 = 1;
    for (i = nian1 + 1; i < nian2; i++) {
      if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) {
        sum = sum + 366;
      } else {
        sum = sum + 365;
      }
    }
    if (flag1 == 1) {
      for (i = yue1 + 1; i <= 12; i++) {
        sum = sum + run[i];
      }
      sum = sum + run[yue1] - ri1;
      if (flag2 == 1) {
        if (nian1 == nian2) {
          for (i = 12; i > yue2; i--) {
            sum = sum - run[i];
          }
          sum = sum + ri2 - run[yue2];
        } else {
          for (i = 1; i < yue2; i++) {
            sum = sum + run[i];
          }
          sum += ri2;
        }
      } else {
        for (i = 1; i < yue2; i++) {
          sum = sum + nun[i];
        }
        sum = sum + ri2;
      }
    } else {
      for (i = yue1 + 1; i <= 12; i++) {
        sum = sum + nun[i];
      }
      sum = sum + nun[yue1] - ri1;
      if (flag2 == 1) {
        for (i = 1; i < yue2; i++) {
          sum = sum + run[i];
        }
        sum = sum + ri2;
      } else {
        if (nian1 != nian2) {
          for (i = 1; i < yue2; i++) {
            sum = sum + nun[i];
          }
          sum = sum + ri2;
        } else {
          for (i = 12; i > yue2; i--) {
            sum = sum - nun[i];
          }
          sum = sum - nun[yue2] + ri2;
        }
      }
    }
    cout << sum << endl;
  }
  return 0;
}
