#include <bits/stdc++.h>
using namespace std;
int T(int s1, int s2);
int W(int w);
int main() {
  int a[3];
  int b[3];
  scanf("%d:%d:%d", &a[0], &a[1], &a[2]);
  scanf("%d:%d:%d", &b[0], &b[1], &b[2]);
  bool ok = 0;
  if (a[0] > b[0]) ok = 1;
  if (a[0] == b[0] && a[1] > b[1]) ok = 1;
  if (a[0] == b[0] && a[1] == b[1] && a[2] > b[2]) ok = 1;
  if (ok == 1) {
    for (int i = 0; i < 3; i++) {
      int h;
      h = a[i];
      a[i] = b[i];
      b[i] = h;
    }
  }
  int t;
  int e1, e2;
  int c = (b[0] - a[0]) * 365;
  int a1 = a[0] % 4;
  int a2 = a[0] % 100;
  int b1 = b[0] % 4;
  int b2 = b[0] % 100;
  int k = 0;
  int d = b[0] - a[0];
  int j = a[0];
  for (int i = 0; i < d; i++) {
    if (W(j) == 1) k++;
    j++;
  }
  int r1, r2;
  r1 = W(a[0]);
  r2 = W(b[0]);
  if (r1 == 1) {
    e1 = T(a[1], a[2]);
    if (a[1] > 2) e1++;
  } else
    e1 = T(a[1], a[2]);
  if (r2 == 1) {
    e2 = T(b[1], b[2]);
    if (b[1] > 2) e2++;
  } else
    e2 = T(b[1], b[2]);
  t = c + k - e1 + e2;
  cout << abs(t) << endl;
  return 0;
}
int T(int s1, int s2) {
  int e;
  int m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int M[12] = {31};
  for (int i = 1; i < 12; i++) M[i] = M[i - 1] + m[i];
  if (s1 > 1)
    e = M[s1 - 2] + s2;
  else
    e = s2;
  return e;
}
int W(int w) {
  int r;
  if (w % 4 == 0 && w % 100 != 0)
    r = 1;
  else if (w % 400 == 0)
    r = 1;
  else
    r = 0;
  return r;
}
