import java.io.IOException;
import java.util.InputMismatchException;

public class Calendar {
	private static final int[][] DAYS = new int[2039][13];
	static {
        for (int y = 1900; y < DAYS.length; y++) {
        	for (int m = 1; m <= 12; m++) {
        		if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
        			DAYS[y][m] = 31;
        		} else if (m == 4 || m == 6 || m == 9 || m == 11) {
        			DAYS[y][m] = 30;
        		} else {
        			if (y % 400 == 0) {
        				DAYS[y][m] = 29;
        			} else if (y % 100 == 0) {
        				DAYS[y][m] = 28;
        			} else if (y % 4 == 0) {
        				DAYS[y][m] = 29;
        			} else {
        				DAYS[y][m] = 28;
        			}
        		}
        	}
        }
	}

    public static void main(String[] args) {
        FasterScanner sc = new FasterScanner();

        String D1 = sc.nextString();
        String D2 = sc.nextString();

        int[] date1 = parseDate(D1);
        int[] date2 = parseDate(D2);

        int days1 = getDays(date1);
        int days2 = getDays(date2);

        System.out.println(Math.abs(days2 - days1));
    }

    public static int getDays(int[] date) {
    	int cnt = date[2];
    	for (int y = 1900; y <= date[0]; y++) {
    		for (int m = 1; m <= 12; m++) {
    			if (y == date[0] && m == date[1]) {
    				break;
    			}
    			cnt += DAYS[y][m];
    		}
    	}
    	return cnt;
    }

    public static int[] parseDate(String date) {
    	String[] tmp = date.split(":");
    	int[] arr = new int[3];
    	for (int i = 0; i < 3; i++) {
    		arr[i] = Integer.parseInt(tmp[i]);
    	}
    	return arr;
    }

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

	    public int[] nextIntArray(int n) {
	        int[] arr = new int[n];
	        for (int i = 0; i < n; i++) {
	            arr[i] = nextInt();
	        }
	        return arr;
	    }

		public long[] nextLongArray(int n) {
		    long[] arr = new long[n];
		    for (int i = 0; i < n; i++) {
		        arr[i] = nextLong();
		    }
		    return arr;
		}

	    private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;

public class Main {

    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        DateFormat df = new SimpleDateFormat("yyyy:MM:dd");
        df.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
        Date d1 = df.parse(s1);
        Date d2 = df.parse(s2);
        System.out.println(Math.abs(d1.getTime()-d2.getTime())/(1000*60*60*24));
    }
}

/**
 * Created by user on 11/14/2019.
 */

import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class dateProblem {
    public static void main(String[] args) throws IOException, ParseException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(System.out));
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date start = format.parse(br.readLine());
        Date end = format.parse(br.readLine());
        double diff = end.getTime()-start.getTime();
        diff/=86400000.0;
        System.out.println(Math.abs(Math.round(diff)));

    }
}

import java.io.IOException;
import java.util.InputMismatchException;

public class Calendar {
    public static void main(String[] args) {
        FasterScanner sc = new FasterScanner();

        String D1 = sc.nextString();
        String D2 = sc.nextString();

        int[] date1 = parseDate(D1);
        int[] date2 = parseDate(D2);

        if (date2[0] < date1[0] || (date2[0] == date1[0] && date2[1] < date1[1])) {
        	int[] tmp = date1;
        	date1 = date2;
        	date2 = tmp;
        }

        int[][] days = new int[2039][13];
        for (int y = 0; y < days.length; y++) {
        	for (int m = 1; m <= 12; m++) {
        		if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
        			days[y][m] = 31;
        		} else if (m == 4 || m == 6 || m == 9 || m == 11) {
        			days[y][m] = 30;
        		} else {
        			if (y % 400 == 0) {
        				days[y][m] = 29;
        			} else if (y % 100 == 0) {
        				days[y][m] = 28;
        			} else if (y % 4 == 0) {
        				days[y][m] = 29;
        			} else {
        				days[y][m] = 28;
        			}
        		}
        	}
        }

        if (date2[0] == date1[0] && date2[1] == date1[1]) {
        	System.out.println(Math.abs(date2[2] - date1[2]));
        	return;
        }

        int cnt = days[date1[0]][date1[1]] - date1[2] + date2[2];
        for (int y = date1[0]; y <= date2[0]; y++) {
        	int start = (y == date1[0]) ? (date1[1] + 1) : 1;
        	int end = (y == date2[0]) ? (date2[1] - 1) : 12;
        	for (int m = start; m <= end; m++) {
        		cnt += days[y][m];
        	}
        }
        System.out.println(cnt);
    }

    public static int[] parseDate(String date) {
    	String[] tmp = date.split(":");
    	int[] arr = new int[3];
    	for (int i = 0; i < 3; i++) {
    		arr[i] = Integer.parseInt(tmp[i]);
    	}
    	return arr;
    }

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

	    public int[] nextIntArray(int n) {
	        int[] arr = new int[n];
	        for (int i = 0; i < n; i++) {
	            arr[i] = nextInt();
	        }
	        return arr;
	    }

		public long[] nextLongArray(int n) {
		    long[] arr = new long[n];
		    for (int i = 0; i < n; i++) {
		        arr[i] = nextLong();
		    }
		    return arr;
		}

	    private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.text.*;

public class A {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String a = sc.next().replaceAll(":", "");
            String b = sc.next().replaceAll(":", "");

            DateFormat df = new SimpleDateFormat("yyyyMMdd");
            Date datea = df.parse(a);
            Date dateb = df.parse(b);

            int xa = get(datea);
            int xb = get(dateb);
            System.out.println(Math.abs(xa - xb));
        }
    }

    static int get(Date date) {
        Calendar lCal = Calendar.getInstance();
        lCal.setTime(date);

        int lYear = lCal.get(Calendar.YEAR);
        int lMonth = lCal.get(Calendar.MONTH) + 1;
        int lDay = lCal.get(Calendar.DATE);
        int a = (14 - lMonth) / 12;
        int y = lYear + 4800 - a;
        int m = lMonth + 12 * a - 3;
        return lDay + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045;
    }
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.text.*;
import java.lang.*;

public final class Main {
    public static void main(String[] args) throws Exception {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));

        String a = next();
        String b = next();
        int y1 = Integer.valueOf(a.substring(0, 4));
        int m1 = Integer.valueOf(a.substring(5, 7));
        int d1 = Integer.valueOf(a.substring(8, 10));
        int y2 = Integer.valueOf(b.substring(0, 4));
        int m2 = Integer.valueOf(b.substring(5, 7));
        int d2 = Integer.valueOf(b.substring(8, 10));
        Calendar aa = new GregorianCalendar(y1, m1-1, d1);
        Calendar bb = new GregorianCalendar(y2, m2-1, d2);
        if (aa.after(bb)) {
            int lo = 0;
            int hi = 1000000;
            int mi;
            while (lo <= hi) {
                mi = (lo+hi)/2;
                Calendar c = new GregorianCalendar(y2, m2-1, d2);
                c.add(Calendar.DAY_OF_MONTH, mi);
                int k = c.compareTo(aa);
                if (k == 0) {
                    out.println(mi);
                    break;
                } else if (k < 0) {
                    lo = mi+1;
                } else {
                    hi = mi;
                }
            }
        } else {
            int lo = 0;
            int hi = 1000000;
            int mi;
            while (lo <= hi) {
                mi = (lo+hi)/2;
                Calendar c = new GregorianCalendar(y1, m1-1, d1);
                c.add(Calendar.DAY_OF_MONTH, mi);
                int k = c.compareTo(bb);
                if (k == 0) {
                    out.println(mi);
                    break;
                } else if (k < 0) {
                    lo = mi+1;
                } else {
                    hi = mi;
                }
            }
        }
        out.flush();
    }

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.StringTokenizer;

/**
 * 304B
 * θ(1) time
 * θ(1) space
 *
 * @author artyom
 */
public class _304B implements Runnable {
    private BufferedReader in;
    private StringTokenizer tok;

    private Object solve() throws IOException {
        return Math.abs(LocalDate.parse(nextToken(), DateTimeFormatter.ofPattern("yyyy:MM:dd")).toEpochDay() -
                LocalDate.parse(nextToken(), DateTimeFormatter.ofPattern("yyyy:MM:dd")).toEpochDay());
    }

    //--------------------------------------------------------------
    public static void main(String[] args) {
        new _304B().run();
    }

    @Override
    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            tok = null;
            System.out.print(solve());
            in.close();
        } catch (IOException e) {
            System.exit(0);
        }
    }

    private String nextToken() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.StringTokenizer;
import java.io.BufferedReader;

import javax.management.Query;

import com.sun.org.apache.bcel.internal.generic.SWAP;

public class fstclass {
	static int[] a = new int[10000100];
	public static void main(String[] args) {
		InputStream inputStream = System.in;
        InputReader in = new InputReader(inputStream);
        int n, m, i, j;
        String s = in.next();
        int x1 = 0, y1 = 0, z1 = 0;
        int id = 0;
        while(s.charAt(id) != ':') {
        	x1 = x1 * 10 + s.charAt(id) - 48;
        	id ++;
        }
        id ++;
        while(s.charAt(id) != ':') {
        	y1 = y1 * 10 + s.charAt(id) - 48;
        	id ++;
        }
        id ++;
        while(id < s.length()) {
        	z1 = z1 * 10 + s.charAt(id) - 48;
        	id ++;
        }
        s = in.next();
        id = 0;
        int x2 = 0, y2 = 0, z2 = 0;
        while(s.charAt(id) != ':') {
        	x2 = x2 * 10 + s.charAt(id) - 48;
        	id ++;
        }
        id ++;
        while(s.charAt(id) != ':') {
        	y2 = y2 * 10 + s.charAt(id) - 48;
        	id ++;
        }
        id ++;
        while(id < s.length()) {
        	z2 = z2 * 10 + s.charAt(id) - 48;
        	id ++;
        }
        if(x1 > x2 || (x1 == x2 && y1 > y2) || (x1 == x2 && y1 == y2 && z1 > z2)) {
        	int t = x1;
        	x1 = x2;
        	x2 = t;
        	t = y1;
        	y1 = y2;
        	y2 = t;
        	t = z1;
        	z1 = z2;
        	z2 = t;
        }
        int[] a = new int[100];
        a[1] = 31;
        a[2] = 28;
        a[3] = 31;
        a[4] = 30;
        a[5] = 31;
        a[6] = 30;
        a[7] = 31;
        a[8] = 31;
        a[9] = 30;
        a[10] = 31;
        a[11] = 30;
        a[12] = 31;
        int cnt = 0;
        while(x1 != x2 || y1 != y2 || z1 != z2) {
        	cnt ++;
        	z1 ++;
        	if(x1 % 4 == 0 && (x1 % 100 != 0 || x1 % 400 == 0))
        		a[2] = 29;
        	else
        		a[2] = 28;
        	if(z1 > a[y1]) {
        		z1 = 1;
        		y1 ++;
        		if(y1 == 13) {
        			y1 = 1;
        			x1 ++;
        		}
        	}
        }
        System.out.print(cnt);
	}

	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

/*
br = new BufferedReader(new FileReader("input.txt"));
pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
br = new BufferedReader(new InputStreamReader(System.in));
pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
 */

public class Main {
	private static BufferedReader br;
	private static StringTokenizer st;
	private static PrintWriter pw;

	public static void main(String[] args) throws IOException   {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		//int qq = 1;
		int qq = Integer.MAX_VALUE;
		//int qq = readInt();
		for(int casenum = 1; casenum <= qq; casenum++)   {
			Date[] list = new Date[2];
			for(int i = 0; i < 2; i++) {
				list[i] = extractDate(nextToken());
			}
			Arrays.sort(list);
			int ret = 0;
			while(!list[0].equals(list[1])) {
				list[0].inc();
				ret++;
			}
			pw.println(ret);
		}
		pw.close();
	}

	public static Date extractDate(String s) {
		int y = Integer.parseInt(s.substring(0,4));
		int m = Integer.parseInt(s.substring(5,7));
		int d = Integer.parseInt(s.substring(8,10));
		return new Date(y,m,d);
	}

	static class Date implements Comparable<Date> {
		public int y,m,d;

		public Date(int y, int m, int d) {
			super();
			this.y = y;
			this.m = m;
			this.d = d;
		}

		public void inc() {
			d++;
			if(pastMonth()) {
				d = 1; m++;
			}
			if(m == 13) {
				m = 1;
				y++;
			}
		}

		public boolean pastMonth() {
			if(m == 2) {
				if(y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))
					return d == 30;
				return d == 29;
			}
			if(m == 4 || m == 6 || m == 9 || m == 11) return d == 31;
			return d == 32;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + d;
			result = prime * result + m;
			result = prime * result + y;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Date other = (Date) obj;
			if (d != other.d)
				return false;
			if (m != other.m)
				return false;
			if (y != other.y)
				return false;
			return true;
		}

		public int compareTo(Date s) {
			if(y != s.y) return y - s.y;
			if(m != s.m) return m - s.m;
			if(d != s.d) return d - s.d;
			return 0;
		}
	}

	private static void exitImmediately()   {
		pw.close();
		System.exit(0);
	}

	private static long readLong() throws IOException   {
		return Long.parseLong(nextToken());
	}

	private static double readDouble() throws IOException   {
		return Double.parseDouble(nextToken());
	}

	private static int readInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	private static String nextToken() throws IOException    {
		while(st == null || !st.hasMoreTokens())    {
			if(!br.ready()) {
				exitImmediately();
			}
			st = new StringTokenizer(br.readLine().trim());
		}
		return st.nextToken();
	}
}

import java.io.*;
import java.util.*;
import java.math.*;

public class solution implements Runnable {

	final int leap_year[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	final int non_leap_year[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	String s;
	int sd, sm, sy, fd, fm, fy;

	public boolean next() {
		if (sd == fd && sm == fm && sy == fy)
			return false;
		sd++;
		if ((sy % 4 == 0 && sy % 100 != 0) || sy % 400 == 0) {
			if (sd > leap_year[sm - 1]) {
				sd = 1;
				sm++;
				if (sm > 12) {
					sm = 1;
					sy++;
				}
			}
		} else {
			if (sd > non_leap_year[sm - 1]) {
				sd = 1;
				sm++;
				if (sm > 12) {
					sm = 1;
					sy++;
				}
			}
		}
		return true;
	}

	public void solve() throws Throwable {
		s = sc.nextToken();
		sy = Integer.parseInt(s.subSequence(0, 4).toString());
		sm = Integer.parseInt(s.substring(5, 7));
		sd = Integer.parseInt(s.substring(8, 10));
		s = sc.nextToken();
		fy = Integer.parseInt(s.subSequence(0, 4).toString());
		fm = Integer.parseInt(s.substring(5, 7));
		fd = Integer.parseInt(s.substring(8, 10));
		if (sy > fy || (sy == fy && (sm > fm || (sm == fm && sd > fd)))) {
			int rtmp = sy;
			sy = fy;
			fy = rtmp;
			rtmp = sm;
			sm = fm;
			fm = rtmp;
			rtmp = sd;
			sd = fd;
			fd = rtmp;
		}
		int ans = 0;
		while (next()) {
			ans++;
		}
		out.println(ans);
	}

	BufferedReader in;
	PrintWriter out;
	FastScanner sc;

	static Throwable uncaught;

	@Override
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			sc = new FastScanner(in);
			solve();
		} catch (Throwable t) {
			solution.uncaught = t;
		} finally {
			out.close();
		}
	}

	public static void main(String[] args) throws Throwable {
		Thread t = new Thread(null, new solution(), "", (1 << 26));
		t.start();
		t.join();
		if (uncaught != null) {
			throw uncaught;
		}
	}

}

class FastScanner {

	BufferedReader reader;
	StringTokenizer strTok;

	public FastScanner(BufferedReader reader) {
		this.reader = reader;
	}

	public String nextToken() throws IOException {
		while (strTok == null || !strTok.hasMoreTokens()) {
			strTok = new StringTokenizer(reader.readLine().trim());
		}
		return strTok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

}

import java.io.*;
import java.util.*;

public class p304b
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.println();
        int a1[] = {31,28,31,30,31,30,31,31,30,31,30,31};
        int a2[] = {31,29,31,30,31,30,31,31,30,31,30,31};
        String str1 = sc.next();
        String str2 = sc.next();
        String s1="",s2="",s3="";
        String e1="",e2="",e3="";
        for(int i=0;i<=3;i++)
        {
            s1 += Character.toString(str1.charAt(i));
            e1 += Character.toString(str2.charAt(i));
        }
        for(int i=5;i<=6;i++)
        {
            s2 += Character.toString(str1.charAt(i));
            e2 += Character.toString(str2.charAt(i));
        }
        for(int i=8;i<=9;i++)
        {
            s3 += Character.toString(str1.charAt(i));
            e3 += Character.toString(str2.charAt(i));
        }
        int y1 = Integer.parseInt(s1);
        int m1 = Integer.parseInt(s2);
        int d1 = Integer.parseInt(s3);
        int y2 = Integer.parseInt(e1);
        int m2 = Integer.parseInt(e2);
        int d2 = Integer.parseInt(e3);
        int count = 0;
        if(y1>y2)
        {
            y1=y1+y2;y2=y1-y2;y1=y1-y2;
            if(m1!=m2) {m1=m1+m2;m2=m1-m2;m1=m1-m2;}
            if(d1!=d2) {d1=d1+d2;d2=d1-d2;d1=d1-d2;}
        }
        else if(y1==y2)
        {
            if(m1>m2)
            {
                m1=m1+m2;m2=m1-m2;m1=m1-m2;
                if(d1!=d2) {d1=d1+d2;d2=d1-d2;d1=d1-d2;}
            }
            else if(m1==m2)
            {
                if(d1>d2){ d1=d1+d2;d2=d1-d2;d1=d1-d2;}
            }
        }
        if((y1==y2)&&(m1==m2)&&(d1==d2)) System.out.println("0");
        else if(ly(y1)==1)
        {
            int l;
            if(ly(y2)==1) l = (y2-y1)/4-1;
            else l = (y2-(y2%4)-y1)/4;
            count += ((y2-y1-1)*365+l+a2[m1-1]-d1+d2);
            for(int i=m1+1;i<=12;i++) count+=a2[i-1];
            if(ly(y2)==1) for(int i=1;i<m2;i++) count+=a2[i-1];
            else for(int i=1;i<m2;i++) count+=a1[i-1];
            System.out.println(count);
        }
        else
        {
            if(d2==29 && m2==2) count += (a1[m1-1]-d1+d2-1);
            else count += (a1[m1-1]-d1+d2);
            for(int i=m1+1;i<=12;i++) count+=a1[i-1];
            count += (y2-y1-1)*365;
            count += lyc(y1,y2);
            for(int i=1;i<m2;i++) count+=a1[i-1];
            if(ly(y2)==1) count++;
            System.out.println(count);
        }
    }

    public static int ly(int year)
    {
        int check = 0;
        if((year%4==0)&&(year%100!=0)) check=1;
        else if(year%400==0) check=1;
        return check;
    }

    public static int lyc(int y1,int y2)
    {
        int c = 0;
        if((y1%4==0)&&(ly(y2)!=1)) c=(y2-y1)/4;
        else if((ly(y1)!=1)&&(ly(y2)==1)) c=(y2-y1)/4;
        else c=(y2-y1-(y2%4)+(y1%4))/4;
        return c;
    }
}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	if (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

    private int nextInt() throws Exception{
	   return Integer.parseInt(next());
    }

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);

	String date1 = next();
	String date2 = next();

	if (compare(date1, date2)) {
	    String c = date1;
	    date1 = date2;
	    date2 = c;
	}

	int month[] = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	String a[] = date1.split(":");
	int y = Integer.parseInt(a[0]);
	int m = Integer.parseInt(a[1])-1;
	int d = Integer.parseInt(a[2]);

	a = date2.split(":");
	int fy = Integer.parseInt(a[0]);
	int fm = Integer.parseInt(a[1])-1;
	int fd = Integer.parseInt(a[2]);

	int r = 0;
	while(3 < 4){

	    if (y == fy && m == fm && d == fd) break;
	    if (isLeapYear(y)) month[1] = 29;
	    else month[1] = 28;

	    d++;
	    if (d > month[m]){
		d = 1;
		m++;
		if (m > 11){
		    m = 0;
		    y++;
		}
	    }
	    r++;
	}
	out.println(r);
	out.close();
    }

    private boolean compare(String d1, String d2){
	String a[] = d1.split(":");
	String b[] = d2.split(":");
	for(int i=0;i<a.length;i++){
	    if (Integer.parseInt(a[i]) > Integer.parseInt(b[i]))
		return true;
	    else if (Integer.parseInt(a[i]) < Integer.parseInt(b[i]))
		return false;
	}
	return false;
    }

    private boolean isLeapYear(int year){
	if (year % 4 != 0)
	    return false;
	if (year % 400 == 0)
	    return true;
	if (year % 100 == 0)
	    return false;
	return true;
    }

    public static void main(String args[]) throws Exception{
	   new Main().run();
    }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//package Practice;

import java.util.*;
import java.io.*;
/**
 *
 * @author Rohan
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    static int y1,y2,m1,m2,d1,d2,res,d;
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        input();
    }

    public static void input() throws IOException{
        int[] days={0,31,28,31,30,31,30,31,31,30,31,30,31};
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String[] S=br.readLine().split(":");
        String[] S1=br.readLine().split(":");
        init(S,S1); res=d=0;
        for(int i=y2;i<=y1;i++){
            if(isLeap(i))res+=366;
            else res+=365;
        }
        for(int i=0;i<2;i++){
            if(i==0){
                for(int j=1;j<m2;j++){
                    if(isLeap(y2) && j==2) d+=29;
                    else d+=days[j];
                }
                d+=d2;
            }
            else{
                for(int j=m1+1;j<=12;j++){
                    if(isLeap(y1) && j==2) d+=29;
                    else d+=days[j];
                }
                if(isLeap(y1) && m1==2) d+=29-d1+1;
                else d+=days[m1]-d1+1;
            }
        }
        System.out.println(res-d+1);
    }

    public static void init(String[] s,String[] s1){
        if(Integer.parseInt(s[0])>Integer.parseInt(s1[0])){
            y1=Integer.parseInt(s[0]); y2=Integer.parseInt(s1[0]);
            m1=Integer.parseInt(s[1]); m2=Integer.parseInt(s1[1]);
            d1=Integer.parseInt(s[2]); d2=Integer.parseInt(s1[2]);
        }
        else if(Integer.parseInt(s[0])<Integer.parseInt(s1[0])){
            y1=Integer.parseInt(s1[0]); y2=Integer.parseInt(s[0]);
            m1=Integer.parseInt(s1[1]); m2=Integer.parseInt(s[1]);
            d1=Integer.parseInt(s1[2]); d2=Integer.parseInt(s[2]);
        }
        else{
            if(Integer.parseInt(s[1])>Integer.parseInt(s1[1])){
                y1=Integer.parseInt(s[0]); y2=Integer.parseInt(s1[0]);
                m1=Integer.parseInt(s[1]); m2=Integer.parseInt(s1[1]);
                d1=Integer.parseInt(s[2]); d2=Integer.parseInt(s1[2]);
            }
            else if(Integer.parseInt(s[1])<Integer.parseInt(s1[1])){
                y1=Integer.parseInt(s1[0]); y2=Integer.parseInt(s[0]);
                m1=Integer.parseInt(s1[1]); m2=Integer.parseInt(s[1]);
                d1=Integer.parseInt(s1[2]); d2=Integer.parseInt(s[2]);
            }
            else{
                if(Integer.parseInt(s[2])>Integer.parseInt(s1[2])){
                    y1=Integer.parseInt(s[0]); y2=Integer.parseInt(s1[0]);
                    m1=Integer.parseInt(s[1]); m2=Integer.parseInt(s1[1]);
                    d1=Integer.parseInt(s[2]); d2=Integer.parseInt(s1[2]);
                }
                else {
                    y1=Integer.parseInt(s1[0]); y2=Integer.parseInt(s[0]);
                    m1=Integer.parseInt(s1[1]); m2=Integer.parseInt(s[1]);
                    d1=Integer.parseInt(s1[2]); d2=Integer.parseInt(s[2]);
                }
            }
        }
    }
    public static boolean isLeap(int y){
        if(y%100==0)
            return y%400==0;
        return y%4==0;
    }
}

import static java.lang.System.*;
import static java.lang.Math.*;

import java.util.*;

public class B304{
    public static Scanner sc = new Scanner(in);
    //public static Random sc=new Random();

    int[] mmap=new int[]{31,28,31,30,31,30,31,31,30,31,30,31};

    public boolean isU(int y){
        return y%400==0 ||(y%100!=0 && y %4==0);
    }
    public int getDate(int y,int m,int d){
        int res=d;
        for(int i=1;i<m;i++){
            res+=mmap[i-1];
            if(i==2 && isU(y))
                res++;
        }

        for(int i=1900;i<y;i++){
            if(isU(i))
                res+=366;
            else
                res+=365;
        }
        return res;
    }

    public void run(){
        String[] from=sc.next().split(":");
        String[] to=sc.next().split(":");

        int f=getDate(Integer.parseInt(from[0]),Integer.parseInt(from[1]),Integer.parseInt(from[2]));
        int t=getDate(Integer.parseInt(to[0]),Integer.parseInt(to[1]),Integer.parseInt(to[2]));

        ln(abs(f-t));

   }

    public static void main(String[] _) {
        new B304().run();
    }

    public int[] nextIntArray(int n){
        int[] res=new int[n];
        for(int i=0;i<n;i++){
            res[i]=sc.nextInt();
        }
        return res;
    }
    public static void pr(Object o) {
        out.print(o);
    }
    public static void ln(Object o) {
        out.println(o);
    }
    public static void ln() {
        out.println();
    }

}

import java.util.ArrayList;
import java.util.Scanner;

public class Main2 {

    public static void main(String args[]){
        Scanner input = new Scanner(System.in);
        String[] s = input.next().split(":");
        String[] e = input.next().split(":");
        if(Integer.parseInt(s[0]) < Integer.parseInt(e[0])){
            System.out.println(calendar(s,e));
        }else if(Integer.parseInt(s[0]) > Integer.parseInt(e[0])){
        	System.out.println(calendar(e,s));
        }else{
        	if(Integer.parseInt(s[1]) < Integer.parseInt(e[1])){
        		System.out.println(calendar(s,e));
        	}else if(Integer.parseInt(s[1]) > Integer.parseInt(e[1])){
        		System.out.println(calendar(e,s));
        	}else{
            	if(Integer.parseInt(s[2]) < Integer.parseInt(e[2])){
            		System.out.println(calendar(s,e));
            	}else if(Integer.parseInt(s[2]) > Integer.parseInt(e[2])){
            		System.out.println(calendar(e,s));
            	}else{
            		System.out.println(0);
            	}
        	}
        }
    }

    public static int calendar(String[] s,String[] e){
    	int sy = Integer.parseInt(s[0]);
    	int sm = Integer.parseInt(s[1]);
    	int sd = Integer.parseInt(s[2]);
    	int gy = Integer.parseInt(e[0]);
    	int gm = Integer.parseInt(e[1]);
    	int gd = Integer.parseInt(e[2]);
    	int day = 0;
    	int[] days = {31,28,31,30,31,30,31,31,30,31,30,31};
    	if(sy != gy){
    		if(sm == 2 && isleap(sy)){
    			day += days[sm-1]-sd+1;
    		}else{
    			day += days[sm-1]-sd;
    		}

    		for(int i = sm ; i < 12 ; i++){
    			if(i == 1 && isleap(sy)){
    				day += days[i]+1;
    			}else{
    				day += days[i];
    			}
    		}

    		sy++;
    		for(int i = sy ; i < gy ; i++){
    			if(isleap(i)){
    				day += 366;
    			}else{
    				day += 365;
    			}
    		}

    		for(int i = 0 ; i < gm-1 ; i++){
    			if(i == 1 && isleap(gy)){
    				day += days[i]+1;
    			}else{
    				day += days[i];
    			}
    		}
    		return (day+gd);
    	}else{
    		if(sm != gm){
	    		if(sm == 2 && isleap(sy)){
	    			day += days[sm-1]-sd+1;
	    		}else{
	    			day += days[sm-1]-sd;
	    		}
	    		for(int i = sm ; i < gm-1 ; i++){
	    			if(i == 1 && isleap(gy)){
	    				day += days[i]+1;
	    			}else{
	    				day += days[i];
	    			}
	    		}
	    		return day+gd;
    		}else{
    			return gd-sd;
    		}
    	}
    }

    public static boolean isleap(int n){
    	if(n % 4 == 0){
    		if(n % 100 == 0){
    			if(n % 400 == 0){
    				return true;
    			}
    			return false;
    		}
    		return true;
    	}
    	return false;
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {

    public static void main(String arg[]) throws IOException
    {

        boolean leap[]=new boolean[2039];

        for(int i=1900;i<=2038;i++)
        {
            if((i%4==0&&i%100!=0))
            {

            leap[i]=true;

            }

        }

        leap[2000]=true;
        int d[]=new int[13];
       d[1]=d[3]=d[5]=d[7]=d[12]=d[10]=d[8]=31;
       d[4]=d[6]=d[9]=d[11]=30;
       d[2]=28;

 //   BufferedReader r=new BufferedReader(new FileReader("testcase.txt"));
   BufferedReader r=new BufferedReader(new InputStreamReader(System.in));

   String s=r.readLine();
   s=s.replaceAll(":", " ");
   StringTokenizer str=new StringTokenizer(s);

int y1=Integer.parseInt(str.nextToken());
int m1=Integer.parseInt(str.nextToken());
int d1=Integer.parseInt(str.nextToken());
s=r.readLine();
   s=s.replaceAll(":", " ");

str=new StringTokenizer(s);
int y2=Integer.parseInt(str.nextToken());
int m2=Integer.parseInt(str.nextToken());
int d2=Integer.parseInt(str.nextToken());

if(y1>y2||(y1==y2&&m1>m2)||(y1==y2&&m1==m2&&d1>d2))
{
   int t=y2;
    y2=y1;
    y1=t;
    t=m2;
    m2=m1;
    m1=t;
    t=d2;
    d2=d1;
    d1=t;
}

int days=0;

if(y1==y2&&m1==m2&&d1==d2)
{    days=0;

}
else
    if(y1==y2&&m1==m2)
    {
        days=d2-d1;
    }
    else if(y1==y2)
    {
        for(int i=m1+1;i<m2;i++)
            days+=d[i];
        days+=d[m1]-d1;
        days+=d2;
        if(leap[y1]&&m1<=2&&m2>2)
        days++;

    }

else
    {
for(int i=y1+1;i<y2;i++)
{

    if(leap[i])
    {
        days=days+366;
    }
    else
        days=days+365;

}

for(int i=m1+1;i<=12;i++)
{
    days+=d[i];
}

for(int i=1;i<m2;i++)
{
    days=days+d[i];
}

if(m1<=2&&leap[y1])
{
    days++;

}
if(m2>2&&leap[y2])
{
    days++;
}
days=days+d[m1]-d1;
days=days+d2;
    }
System.out.println(days);

}
    }

import java.io.*;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

public class Main {
    static void zap() throws IOException {
        String date = nextToken();
        int yy = Integer.parseInt(date.substring(0,0+4));
        int mm = Integer.parseInt(date.substring(5,5+2));
        int dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c1 = new GregorianCalendar();
        c1.set(yy,mm-1,dd);
        date = nextToken();
        yy = Integer.parseInt(date.substring(0,0+4));
        mm = Integer.parseInt(date.substring(5,5+2));
        dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c2 = new GregorianCalendar();
        c2.set(yy,mm-1,dd);
        long ms = Math.abs(c2.getTimeInMillis() - c1.getTimeInMillis());
        out.printf("%.0f",ms/(24. * 3600. * 1000.));
    }

    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        InputStream input = System.in;
        //InputStream input = new FileInputStream("fileIn.in");
        OutputStream output = System.out;
        //OutputStream output = new FileOutputStream("fileOut.out");
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        zap();
        out.close();
    }

    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.StringTokenizer;

public class B_183 {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));
		String s1 = next();
		String s2 = next();
		int y1 = Integer.parseInt(s1.substring(0, 4));
		int m1 = Integer.parseInt(s1.substring(5, 7));
		int d1 = Integer.parseInt(s1.substring(8, 10));
		int y2 = Integer.parseInt(s2.substring(0, 4));
		int m2 = Integer.parseInt(s2.substring(5, 7));
		int d2 = Integer.parseInt(s2.substring(8, 10));
		int ans = 0;
		if (y2 < y1 || (y2 == y1 && m2 < m1)
				|| (y1 == y2 && m1 == m2 && d2 < d1)) {
			int sw = y1;
			y1 = y2;
			y2 = sw;
			sw = m1;
			m1 = m2;
			m2 = sw;
			sw = d1;
			d1 = d2;
			d2 = sw;
		}
		while (true) {
			if (d1 == d2 && m1 == m2 && y1 == y2) {
				System.out.println(ans);
				pw.close();
				break;
			}
			d1++;
			ans++;
			if (m1 == 2) {
				if ((y1 % 400 == 0 || (y1 % 4 == 0 && y1 % 100 != 0))) {
					// System.out.println(d1 + " " + m2 + " " + y1);
					if (d1 == 30) {
						d1 = 1;
						m1++;
					}
				} else if (d1 == 29) {
					d1 = 1;
					m1++;
				}
			}
			if (m1 == 4 || m1 == 6 || m1 == 9 || m1 == 11) {
				if (d1 > 30) {
					d1 = 1;
					m1++;
				}
			}
			if (m1 == 1 || m1 == 3 || m1 == 5 || m1 == 7 || m1 == 8 || m1 == 10
					|| m1 == 12) {
				if (d1 > 31) {
					d1 = 1;
					m1++;
				}
			}
			if (m1 > 12) {
				m1 = 1;
				y1++;
			}
		}

	}

	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	private static String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}

import java.math.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class CF {
    public static void main(String[] args) throws ParseException
    {
        Scanner in = new Scanner(System.in);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");

        sdf.setTimeZone(TimeZone.getDefault());

        Date from = sdf.parse(in.next());
        Date to = sdf.parse(in.next());

        System.out.print(Math.round(Math.abs(to.getTime() - from.getTime()) / 86400000.));
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static int leap(int y) {
        if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)
            return 1;
        return 0;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] s = new String[2];
        s[0] = in.nextLine();
        s[1] = in.nextLine();
        Arrays.sort(s);
        int[] months = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        String[] a = s[0].split(":");
        String[] b = s[1].split(":");
        int y1 = Integer.parseInt(a[0]), m1 = Integer.parseInt(a[1]), d1 = Integer
                .parseInt(a[2]);
        int y2 = Integer.parseInt(b[0]), m2 = Integer.parseInt(b[1]), d2 = Integer
                .parseInt(b[2]);
        int tot = -(d1 - 1);
        d1 = 1;
        int temp = 0;
        while (true) {
            // System.out.println(y1+" "+m1+" "+d1);
            if (y1 == y2 && m1 == m2) {
                tot += d2 - d1;
                break;
            }
            tot += months[m1];
            if (m1 == 2 && leap(y1) == 1)
                tot++;
            m1 = (m1 + 1) % 13;
            if (m1 == 0) {
                m1++;
                y1++;
            }
            temp++;
        }
        System.out.println(tot);
    }
}

import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class calender
 {
  public static void main(String args[]) throws IOException
   {
    BufferedReader cin=new BufferedReader(new InputStreamReader(System.in));
    int days1[]={31,29,31,30,31,30,31,31,30,31,30,31};
    int days2[]={31,28,31,30,31,30,31,31,30,31,30,31};
    String s=cin.readLine();
    String tok[]=s.split(":");

    int yy1=Integer.parseInt(tok[0]);
    int mm1=Integer.parseInt(tok[1]);
    int dd1=Integer.parseInt(tok[2]);
    s=cin.readLine();
    tok=s.split(":");
    int yy2=Integer.parseInt(tok[0]);
    int mm2=Integer.parseInt(tok[1]);
    int dd2=Integer.parseInt(tok[2]);
    int sum=0;
    int totdays=0;
    if(yy1<yy2)
    {
    if(yy1%4==0 && yy1%100!=0 || yy1%400==0)
    {
      //System.out.println("yy1 "+ yy1);
           for(int i=0;i<mm1-1;i++)
             {
              sum=sum+days1[i];
              }
            sum=sum+dd1;
            //System.out.println("if yy1 is lp " + sum);
          totdays=(366-sum);

     }
     else
     {
           for(int i=0;i<mm1-1;i++)
             {
              sum=sum+days2[i];
              }
            sum=sum+dd1;
            //System.out.println("if yy1 is not lp " + sum);
       totdays=(365-sum);
       //System.out.println("if totdays is not lp " + totdays);
     }
sum=0;
    if(yy2%4==0 && yy2%100!=0 || yy2%400==0)
    {
           for(int i=0;i<mm2-1;i++)
             {
              sum=sum+days1[i];
              }
            sum=sum+dd2;
            //System.out.println("if yy2 is lp " + sum);
          totdays=totdays+sum;
          }
     else
     {
           for(int i=0;i<mm2-1;i++)
             {
              sum=sum+days2[i];
              }
            sum=sum+dd2;
            //System.out.println("if yy2 is not lp " + sum);
       totdays=totdays+sum;

     }
     for(int i=yy1+1;i<yy2;i++)
    {
       if(i%4==0 && i%100!=0 || i%400==0)
       {
         //System.out.println("leap years"+ i);
          totdays=totdays+366;

       }
     else
     {
       totdays=totdays+365;
     }

    }
    System.out.println(totdays);

    }
    else if(yy1>yy2)
    {
    if(yy2%4==0 && yy2%100!=0 || yy2%400==0)
    {
           for(int i=0;i<mm2-1;i++)
             {
              sum=sum+days1[i];
              }
            sum=sum+dd2;
            //System.out.println("if yy2 is lp " + sum);
          totdays=(366-sum);
          //totdays++;

     }
     else
     {
           for(int i=0;i<mm2-1;i++)
             {
              sum=sum+days2[i];
              }
            sum=sum+dd2;
          //System.out.println("if yy2 is not lp " + sum);
       totdays=(365-sum);
       //totdays++;
     }
   sum=0;
     if(yy1%4==0 && yy1%100!=0 || yy1%400==0)
    {
           for(int i=0;i<mm1-1;i++)
             {
              sum=sum+days1[i];
              }
            sum=sum+dd1;
            //System.out.println("if yy1 is lp " + sum);
          totdays=totdays+sum;

     }
     else
     {
           for(int i=0;i<mm1-1;i++)
             {
              sum=sum+days2[i];
              }
            sum=sum+dd1;
            //System.out.println("if yy1 is not lp " + sum);
       totdays=totdays+sum;
     }
     for(int i=yy2+1;i<yy1;i++)
    {
      if(i%4==0 && i%100!=0 || i%400==0)
       {
         //System.out.println("leap years"+ i);
          totdays=totdays+366;

     }
     else
     {
       totdays=totdays+365;
     }
    }
    System.out.println(totdays);

    }
    else
    {
    int sum1=0;
    int sum2=0;
      if(yy1%4==0 && yy1%100!=0 || yy1%400==0)
    {
           for(int i=0;i<mm1-1;i++)
             {
              sum=sum+days1[i];
              }
            sum=sum+dd1;
            //System.out.println("if yy1 is lp " + sum);
          //totdays=totdays+sum;
          sum1=sum;
     }
     else
     {
           for(int i=0;i<mm1-1;i++)
             {
              sum=sum+days2[i];
              }
            sum=sum+dd1;
            //System.out.println("if yy1 is not lp " + sum);
       //totdays=totdays+sum;
          sum1=sum;
     }
    sum=0;
    if(yy2%4==0 && yy2%100!=0 || yy2%400==0)
    {
           for(int i=0;i<mm2-1;i++)
             {
              sum=sum+days1[i];
              }
            sum=sum+dd2;
            //System.out.println("if yy1 is lp " + sum);
          //totdays=totdays+sum;
          sum2=sum;
     }
     else
     {
           for(int i=0;i<mm2-1;i++)
             {
              sum=sum+days2[i];
              }
            sum=sum+dd2;
            //System.out.println("if yy1 is not lp " + sum);
       //totdays=totdays+sum;
          sum2=sum;
     }
     System.out.println(Math.abs(sum2-sum1));

    }
}
}

import java.util.*;
import java.io.*;
public class a {
  static long mod = 1000000000l;
  public static int n;
  public static int[][] twos, fives, memo, memo2;
  public static char[][] res, res2;
public static void main(String[] args) throws IOException
{
  input.init(System.in);
  PrintWriter out = new PrintWriter(System.out);
  String s1 = input.next(), s2 = input.next();
  int y1 = Integer.parseInt(s1.substring(0, 4));
  int m1 = Integer.parseInt(s1.substring(5, 7));
  int d1 = Integer.parseInt(s1.substring(8, 10));
  int y2 = Integer.parseInt(s2.substring(0, 4));
  int m2 = Integer.parseInt(s2.substring(5, 7));
  int d2 = Integer.parseInt(s2.substring(8, 10));
  if(y1>y2 || y1 == y2 && m1>m2 || y1 == y2 && m1 == m2 && d1 > d2)
  {
      int temp = y1;
      y1 = y2; y2 = temp;
      temp = m1;
      m1 = m2; m2 = temp;
      temp = d1;
      d1 = d2; d2 = temp;
  }
  int[] days = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int res = 0;
  while(y1<y2||m1<m2||d1<d2)
  {
      d1++;
      res++;
      if(!(m1 == 2 && d1 == 29 && y1 %4 == 0 && (y1 % 100 != 0 || y1%400 == 0)))
      if(d1 > days[m1-1])
      {
        m1++;
        if(m1 == 13)
        {
            y1++;
            m1 = 1;
        }
        d1 = 1;
      }
  }
  out.println(res);
  out.close();

}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

  static int nextInt() throws IOException {
      return Integer.parseInt( next() );
  }

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			else if (y < d1.y)
				return -1;

			if (m > d1.m)
				return 1;
			else if (m < d1.m)
				return -1;

			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		answer += d2.d;
		if (d2.m == 2 && d2.d == 29)
			answer--;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(answer);
	}
}

import java.io.*;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    static final int INF = Integer.MAX_VALUE;

    static void mergeSort(int[] a, int[] b, int p, int r) {
        if (p < r) {
            int q = (p + r) / 2;
            mergeSort(a, b, p, q);
            mergeSort(a, b, q + 1, r);
            merge(a, b, p, q, r);
        }
    }

    static void merge(int[] a, int[] b, int p, int q, int r) {
        int n1 = q - p + 1;
        int n2 = r - q;
        int[] L = new int[n1 + 1], R = new int[n2 + 1];
        int[] L1 = new int[n1 + 1], R1 = new int[n2 + 1];

        for (int i = 0; i < n1; i++) {
            L[i] = a[p + i];
            L1[i] = b[p + i];

        }
        for (int i = 0; i < n2; i++) {
            R[i] = a[q + 1 + i];
            R1[i] = b[q + 1 + i];

        }
        L[n1] = R[n2] = INF;
        L1[n1] = R1[n2] = INF;

        for (int k = p, i = 0, j = 0; k <= r; k++) {
            if (L[i] <= R[j]) {
                a[k] = L[i];
                b[k] = L1[i++];

            } else {
                a[k] = R[j];
                b[k] = R1[j++];

            }
        }
    }

    static void mergeSort(int[] a, int p, int r) {
        if (p < r) {
            int q = (p + r) / 2;
            mergeSort(a, p, q);
            mergeSort(a, q + 1, r);
            merge(a, p, q, r);
        }
    }

    static void merge(int[] a, int p, int q, int r) {
        int n1 = q - p + 1;
        int n2 = r - q;
        int[] L = new int[n1 + 1], R = new int[n2 + 1];

        for (int i = 0; i < n1; i++) {
            L[i] = a[p + i];

        }
        for (int i = 0; i < n2; i++) {
            R[i] = a[q + 1 + i];

        }
        L[n1] = R[n2] = INF;

        for (int k = p, i = 0, j = 0; k <= r; k++) {
            if (L[i] <= R[j]) {
                a[k] = L[i++];

            } else {
                a[k] = R[j++];

            }
        }
    }

    public static int[] sieve(int n) {
        int a[] = new int[n + 1];
        for (int i = 2; i <= n; i++) {
            a[i] = 1;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (a[i] == 1) {
                for (int k = 2; i * k <= n; k++) {
                    a[i * k] = 0;
                }
            }
        }
        return a;
    }

    public static long sum(int a) {
        long su = 0;
        while (a > 0) {
            su += (long) a % 10;
            a /= 10;
        }
        return su;
    }

    public static int divi(int b) {
        int n = 0;
        for (int i = 2; i <= Math.sqrt(b); i++) {
            if (b % i == 0) {
                n = i;
                break;
            }
        }
        if (n == 0) {
            return b;
        }
        return n;
    }

    public static boolean prime(int n) {
        if (n == 1) {
            return true;
        }

        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static String reve(int a, int b, String s) {
        String q = "";
        for (int i = b; i >= a; i--) {
            q += s.charAt(i);
        }
        return q;
    }

    public static boolean isvowel(char c) {
        if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y') {
            return true;
        } else {
            return false;
        }
    }

    static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public static int hole(int n) {
        int y = 0;
        if (n == 1) {
            return 0;
        }
        if (prime(n)) {
            return 1;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                if (prime(i)) {
                    y++;
                }
                if (prime(n / i) && i != (n / i)) {
                    y++;
                }
            }
        }
        return y;
    }

    static List<Integer> gd(int a, int b) {
        int m = (int) gcd(a, b);
        List<Integer> q = new ArrayList();
        for (int i = 1; i * i <= m; ++i) {
            if (m % i == 0) {
                q.add(i);
                if (i != m / i) {
                    q.add(m / i);
                }
            }
        }
        return q;
    }

    static boolean contain(int[] a) {
        for (int i = 1; i < a.length; i++) {
            if (a[i] == 0) {
                return true;
            }
        }
        return false;
    }

    static void decrease(int[] a) {
        for (int i = 1; i < a.length; i++) {
            a[i]--;
        }
    }

    static long power(StringBuilder s) {
        long c = 1, sum = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'C') {
                c *= 2;
            } else {
                sum += c;
            }
        }
        return sum;
    }

    static long sum(long n) {
        return n * (n + 1) / 2;
    }

    static int divisors(int n) {
        Set<Integer> c = new HashSet();
        for (int i = 1; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                c.add(i);
                c.add((int) (n / i));
            }
        }
        return c.size();
    }

    public static void main(String[] args) throws IOException, ParseException {
        InputReader in = new InputReader(System.in);
        OutputWriter or = new OutputWriter(System.out);

        DateFormat df = new SimpleDateFormat("yyyy:MM:dd");
        df.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
        Date d1 = df.parse(in.nextLine());
        Date d2 = df.parse(in.nextLine());
        or.print(Math.abs(d1.getTime()-d2.getTime())/(1000*60*60*24));
        or.flush();
    }
}

class Pair implements Comparable<Pair> {

    int ind;
    int lef;
    int arr;

    public Pair(int n, int p, int C) {
        ind = n;
        arr = p;
        lef = C;
    }

    @Override
    public int compareTo(Pair o) {
        if (o.arr - arr == 0) {
            return -1 * (o.ind - ind);
        }

        return -1 * (o.arr - arr);
    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}

import java.util.Arrays;
import java.util.Scanner;

public class B {
    static int[] days = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] c = { sc.next(), sc.next() };
        Arrays.sort(c);
        String[] date1 = c[0].split(":"), date2 = c[1].split(":");
        int y1 = p(date1[0]), m1 = p(date1[1]), d1 = p(date1[2]), y2 = p(date2[0]), m2 = p(date2[1]), d2 = p(date2[2]);
        long res = 0;
        if (y1 == y2) {
            if (m1 <= 2 && m2 > 2 && Leap(y2))
                res++;
            if (m1 == m2) {
                System.out.println(d2 - d1);
                return;
            }
            res += days[m1] - d1 + 1;

            for (int j = m1 + 1; j <= m2 - 1; j++)
                res += days[j];
            res += d2 - 1;
            System.out.println(res);
            return;

        }
        res = go(y1, y2, m1, m2, d1, d2);
        System.out.println(res);
    }

    private static int go(int y1, int y2, int m1, int m2, int d1, int d2) {
        int ans = days[m1] - d1 + 1;

        for (int j = m1 + 1; j <= 12; j++)
            ans += days[j];
        if (m1 <= 2 && Leap(y1))
            ans++;
        for (int i = y1 + 1; i <= y2 - 1; i++) {
            if (Leap(i))
                ans++;
            for (int j = 1; j <= 12; j++)
                ans += days[j];
        }

        for (int j = 1; j < m2; j++)
            ans += days[j];
        ans += d2 - 1;
        if (m2 > 2 && Leap(y2))
            ans++;
        return ans;
    }

    static boolean Leap(int year) {
        return ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));
    }

    static int p(String s) {
        return Integer.parseInt(s);
    }
}

//in the name of god
import java.util.*;
public class calender
{
public static boolean leap(int yr){

if(yr%4==0&&yr%100!=0||yr%400==0)
return true;
return false;
}
public static void main(String[] args){
int m[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int lm[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
Scanner s=new Scanner(System.in);
String a=s.next();/*1932:11:18
2028:09:25*/
String b=s.next();
int ans=0;int o=0;
int ar[]=new int[3];
for(String s1:a.split(":")) {ar[o++]=Integer.parseInt(s1);}
int year1=ar[0];int mon1=ar[1];int day1=ar[2];
o=0;
int h=0;
for(String s1:b.split(":")) {ar[o++]=Integer.parseInt(s1);}
int year2=ar[0];int mon2=ar[1];int day2=ar[2];
if(year1>year2){
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;
}
if(year1==year2){
if(mon1>mon2)
{
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;

}
}
if(year1==year2&&mon1==mon2&&day1>day2){
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;

}

for(int i=year1+1;i<year2;i++)
if(leap(i)) ans+=366;
else
ans+=365;int pls=ans;
if(year1==year2)
{
if(leap(year1)){
for(int i=mon1+1;i<mon2;i++)
ans+=lm[i];
if(mon1==mon2)
{
ans+=Math.abs(day1-day2);
System.out.print(ans);return;
}
else
{
ans+=lm[mon1]-day1+1;
//System.out.println(ans);
ans+=day2-1;
//System.out.println(ans);
}
}
else {
for(int i=mon1+1;i<mon2;i++)
ans+=m[i];
if(mon1==mon2)
{
ans+=Math.abs(day1-day2);
System.out.print(ans);return;
}
else
{
ans+=m[mon1]-day1+1;
ans+=day2-1;
}
}
System.out.print(ans);
return;
}
if(leap(year2))
{for(int i=1;i<mon2;i++)
ans+=lm[i];
}else
{for(int i=1;i<mon2;i++)
ans+=m[i];
}
ans+=day2-1;
int minus=0;
if(leap(year1))
{
for(int i=1;i<mon1;i++)
minus+=lm[i];
minus+=day1-1;
minus=366-minus;
}
else {
for(int i=1;i<mon1;i++)
minus+=m[i];
minus+=day1-1;
minus=365-minus;
}

ans+=minus;
System.out.print(ans);
}
}

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;

public class B
{
        String line;
        StringTokenizer inputParser;
        BufferedReader is;
        FileInputStream fstream;
        DataInputStream in;
        String FInput="";

        void openInput(String file)
        {

                if(file==null)is = new BufferedReader(new InputStreamReader(System.in));//stdin
                else
                {
                        try{

                        fstream = new FileInputStream(file);
                        in = new DataInputStream(fstream);
                        is = new BufferedReader(new InputStreamReader(in));
                        }catch(Exception e)
                        {
                                System.err.println(e);
                        }
                }

        }

        void readNextLine()
    	{
    		try {
    			line = is.readLine();
    			inputParser = new StringTokenizer(line, " ,\t");
    			//System.err.println("Input: " + line);
    		} catch (IOException e) {
    			System.err.println("Unexpected IO ERROR: " + e);
    		}
    		catch (NullPointerException e)
    		{
    			line=null;

    		}

    	}

        long NextLong()
        {
                String n = inputParser.nextToken();

                long val = Long.parseLong(n);

                 return val;
        }

        int NextInt()
        {
                String n = inputParser.nextToken();
                int val = Integer.parseInt(n);

                //System.out.println("I read this number: " + val);
                return val;
        }

        String NextString()
        {
                String n = inputParser.nextToken();
                return n;
        }

        void closeInput()
        {
                try {
                        is.close();
                } catch (IOException e) {
                        System.err.println("Unexpected IO ERROR: " + e);
                }

        }

        public static void main(String [] argv)
        {
                //String filePath="input.txt";
        		//String filePath="D:\\_d\\learn\\coursera\\algorithms and design I\\data\\HashInt.txt";
                String filePath=null;
                if(argv.length>0)filePath=argv[0];
                new B(filePath);

        }

        public void readFInput()
    	{
    		for(;;)
    		{
    			try
    			{
    				readNextLine();
    				FInput+=line+" ";
    			}
    			catch(Exception e)
    			{
    				break;
    			}
    		}
    		inputParser = new StringTokenizer(FInput, " ");
    	}

        public B(String inputFile)
        {
        	openInput(inputFile);
    		readNextLine();
    		StringTokenizer st=new StringTokenizer(line, ":");
    		int ay=Integer.parseInt(st.nextToken());
    		int am=Integer.parseInt(st.nextToken())-1;
    		int ad=Integer.parseInt(st.nextToken());

    		readNextLine();
    		st=new StringTokenizer(line, ":");
    		int by=Integer.parseInt(st.nextToken());
    		int bm=Integer.parseInt(st.nextToken())-1;
    		int bd=Integer.parseInt(st.nextToken());

    		if(by<ay||(by==ay&&bm<am)||(by==ay&&bm==am&&bd<ad))
    		{
    			int ty=ay;
    			int tm=am;
    			int td=ad;
    			ay=by;
    			am=bm;
    			ad=bd;

    			by=ty;
    			bm=tm;
    			bd=td;
    		}

    		int [] md = {31,28,31,30,31,30,31,31,30,31,30,31};

    		int s=0;
    		while(ay<by||am<bm||ad<bd)
    		{
    			ad++;
    			if(ad>md[am])
    			{
    				if(am==1)
    				{
    					boolean isLeap=false;
    					//feb
    					if(ay%4==0)
    					{
    						isLeap=true;
    						if(ay%100==0)isLeap=false;
    						if(ay%400==0)isLeap=true;
    					}
    					if(isLeap&&ad==29)
    					{

    					}
    					else
    					{
    						am++;
    						ad=1;
    					}
    				}
    				else
    				{
    					am++;
    					ad=1;
    					if(am==12)
    					{
    						am=0;
    						ay++;
    					}
    				}
    			}

    			s++;
    		}

        	System.out.println(s);

    		closeInput();
    	}

}

import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;

public class Calendar {

    public static void main(String[] args) throws IOException, ParseException {
        Scanner in = new Scanner(System.in);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy:MM:dd");
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        Date from = simpleDateFormat.parse(in.nextLine());
        Date to = simpleDateFormat.parse(in.nextLine());
        System.out.println(Math.abs((to.getTime() - from.getTime()) / 86400000));
    }
}

import java.math.BigInteger;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class B_304 {

	public static int fairfield(int y, int m, int d){
		if(m <= 2){
			y--;
			m += 12;
		}

		return (365 * y) + (y / 4) - (y / 100) + (y / 400) + (306 * (m + 1) / 10) + d - 408;
	}

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		String[] input1 = sc.next().split(":");
		String[] input2 = sc.next().split(":");

		final int y1 = Integer.parseInt(input1[0]);
		final int m1 = Integer.parseInt(input1[1]);
		final int d1 = Integer.parseInt(input1[2]);
		final int y2 = Integer.parseInt(input2[0]);
		final int m2 = Integer.parseInt(input2[1]);
		final int d2 = Integer.parseInt(input2[2]);

		final int days1 = fairfield(y1, m1, d1);
		final int days2 = fairfield(y2, m2, d2);
		System.out.println(Math.max(days1 - days2, days2 - days1));
	}

}

import java.util.*;
import static java.lang.Math.*;
public class ProblemB {
    int first_year = 1900;
    int[] months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    void run() {
        Scanner sc = new Scanner(System.in);
        int d1 = day(sc.next());
        int d2 = day(sc.next());
        p("%d\n", abs(d2 - d1));
    }

    int day(String s) {
        int Y = Integer.parseInt(s.substring(0, 4), 10);
        int M = Integer.parseInt(s.substring(5, 7), 10);
        int D = Integer.parseInt(s.substring(8, 10), 10);

        int ret = 0;
        for (int y = first_year; y < Y; ++y) {
            ret += num_days(y);
        }
        for (int m = 1; m < M; ++m) {
            ret += num_days_in_month(m, Y);
        }
        ret += D;

        return ret;
    }

    int num_days_in_month(int m, int y) {
        if (m == 2 && is_leap(y)) {
            return 29;
        }
        return months[m];
    }

    int num_days(int y) {
        if (is_leap(y)) {
            return 366;
        }
        else {
            return 365;
        }
    }

    boolean is_leap(int y) {
        if (y % 400 == 0) {
            return true;
        }
        if (y % 100 == 0) {
            return false;
        }
        if (y % 4 == 0) {
            return true;
        }
        return false;
    }

    boolean debug = false;
    void p(String f, Object...params) {
        System.out.printf(f, params);
    }
    void d(Object...params) {
        if (debug) {
            p("DEBUG: %s\n", Arrays.deepToString(params));
        }
    }
    void die() {
        throw new RuntimeException();
    }
    void timeout() {
        for (int x = 0; ; ++x);
    }
    public ProblemB(String[] args) {
        if (args.length > 0 && args[0].equals("debug")) {
            debug = true;
        }
    }
    public static void main(String[] args) {
        new ProblemB(args).run();
    }
}

import java.text.*;
import java.util.*;
public class Cal{
    public static void main(String[] args){
        Scanner input=new Scanner(System.in);
        String str1,str2;
        double day;
        str1=input.next();
        str2=input.next();
        SimpleDateFormat d=new SimpleDateFormat("yyyy:MM:dd");
        Date date1=null,date2=null;
        try{
            date1=d.parse(str1);
            date2=d.parse(str2);
        }
        catch (ParseException e) {
            e.printStackTrace();
        }
        if(date1.getTime()>date2.getTime())
            day=date1.getTime()-date2.getTime()+9*1000*60*60;
        else
            day=date2.getTime()-date1.getTime()+9*1000*60*60;
        day=day/(1000*60*60*24);
        System.out.println((int)day);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Calendar {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);

		int[] days = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

		String[] first = in.next().split(":");
		String[] second = in.next().split(":");

		int fYear = Integer.parseInt(first[0]);
		int fMonth = Integer.parseInt(first[1]);
		int fDay = Integer.parseInt(first[2]);

		int secYear = Integer.parseInt(second[0]);
		int secMonth = Integer.parseInt(second[1]);
		int secDay = Integer.parseInt(second[2]);

		if (fYear > secYear) {
			secYear = Integer.parseInt(first[0]);
			secMonth = Integer.parseInt(first[1]);
			secDay = Integer.parseInt(first[2]);

			fYear = Integer.parseInt(second[0]);
			fMonth = Integer.parseInt(second[1]);
			fDay = Integer.parseInt(second[2]);
		} else if (fMonth > secMonth && fYear == secYear) {
			secYear = Integer.parseInt(first[0]);
			secMonth = Integer.parseInt(first[1]);
			secDay = Integer.parseInt(first[2]);

			fYear = Integer.parseInt(second[0]);
			fMonth = Integer.parseInt(second[1]);
			fDay = Integer.parseInt(second[2]);
		} else if (fDay > secDay && fYear == secYear && fMonth == secMonth) {
			secYear = Integer.parseInt(first[0]);
			secMonth = Integer.parseInt(first[1]);
			secDay = Integer.parseInt(first[2]);

			fYear = Integer.parseInt(second[0]);
			fMonth = Integer.parseInt(second[1]);
			fDay = Integer.parseInt(second[2]);
		}

		int res = 0;
		while(!(fYear == secYear && fMonth == secMonth && fDay == secDay)) {
			res++;

			fDay++;
			if (fMonth != 2) {
				if (fDay > days[fMonth - 1]) {
					fDay = 1;
					fMonth++;
					if (fMonth > 12) {
						fYear++;
						fMonth = 1;
					}
				}
			} else {
				int febDays = 0;
				if ((fYear % 4 == 0 && fYear % 100 != 0) || (fYear % 400 == 0)) {
					febDays = 29;
				} else {
					febDays = 28;
				}

				if (fDay > febDays) {
					fDay = 1;
					fMonth++;
				}
			}
		}

		out.println(res);
		out.close();
		System.out.println("done");
	}
}
class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream));
		tokenizer = null;
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}

import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;
 public class A{

    static FastReader scan=new FastReader();
   public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));

   static int n;
   static char orig[][];

   static int check(char arr[][]){
    int c=0;

    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
        if(arr[j][i]!='1')
            continue;
        if(j==n-1&&arr[j][i]=='1')
            c++;

}

    }
return c;
   }
   static int tmp=0;
   static int solve(int op){
    char arr[][]=new char[n][n];
            for(int l = 0; l <n; l++)
{
  for (int m = 0; m < n; m++)
  {
    arr[l][m] = orig[l][m];
  }
}

for(int i=0;i<n;i++){
   if(arr[op][i]=='1')
                arr[op][i]='0';
            else arr[op][i]='1';
     }
   tmp=Math.max(tmp,check(arr));

return tmp;
   }
   static long max=(long)1e8;
   static boolean leap[]=new boolean [2039];
static void ini(){
    for(int i=0;i<2039;i++)
    {
        if(i%400==0||i%4==0&&i%100!=0)
            leap[i]=true;
    }
}
static void brute(long n,long x,long sum){

            for(int i=0;i<=max;i++){
                if((sum+i)/(n+1)==x&&(sum+i)%(n+1)==0)
                {
                    out.println("YES");
                    out.println(i);
                    continue ;
                }

            //out.println("NO");

        }
}
static long calNum(long year)
{
    return (year / 4) - (year / 100) +
                        (year / 400);
}
static void leapNum(long l, long r)
{
    l--;
    long num1 = calNum(r);
    long num2 = calNum(l);
    System.out.print(num1 - num2 +"\n");
}
public static void main(String[] args)  throws Exception
{
  String s1=scan.next();
  String s2=scan.next();
SimpleDateFormat ft = new SimpleDateFormat("yyyy:MM:dd");
 ft.setTimeZone(TimeZone.getTimeZone("UTC"));
  Date d1=ft.parse(s1);
        Date d2=ft.parse(s2);
         long start=d1.getTime()/(3600*24*1000);
        long end=d2.getTime()/(3600*24*1000);
        out.println(Math.abs(end-start));

 out.close();

}
 public static  long pow(long b, long e) {
            long r = 1;
            while (e > 0) {
                if (e % 2 == 1) r = r * b ;
                b = b * b;
                e >>= 1;
            }
            return r;
        }
private static void sort(long[] arr) {
        List<Long> list = new ArrayList<>();
        for (long object : arr) list.add(object);
        Collections.sort(list);
        for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
    }
 public static class FastReader {
        BufferedReader br;
        StringTokenizer root;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (root == null || !root.hasMoreTokens()) {
                try {
                    root = new StringTokenizer(br.readLine());
                } catch (Exception addd) {
                    addd.printStackTrace();
                }
            }
            return root.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (Exception addd) {
                addd.printStackTrace();
            }
            return str;
        }
         public int[] nextIntArray(int arraySize) {
            int array[] = new int[arraySize];

            for (int i = 0; i < arraySize; i++) {
                array[i] = nextInt();
            }

            return array;
        }
}
static class pair{
    int i;
    int j;
pair(int i,int j){
    this.i=i;
    this.j=j;
}

}}

import java.util.Calendar;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static class date_Comparator implements Comparator<Calendar> {
		@Override
		public int compare(Calendar o1, Calendar o2) {
			// TODO Auto-generated method stub
			int a=o1.get(Calendar.YEAR),b=o1.get(Calendar.MONTH),c=o1.get(Calendar.DAY_OF_MONTH);
			int x=o2.get(Calendar.YEAR),y=o2.get(Calendar.MONTH),z=o2.get(Calendar.DAY_OF_MONTH);
			if(a==x) {
				if(b==y) {
					if(c==z) return 0;
					else if(c>z) return 1;
					else return -1;
				}else if(b>y) return 1;
				else return -1;
			}else if(a>x) return 1;
			else return -1;
		}
	}
	static Scanner in=new Scanner(System.in);
	static date_Comparator d=new date_Comparator();
	private static Calendar get() {
		int num[]=new int[3];
		String s=in.nextLine();
		String x[]=s.split(":");
		for(int i=0;i<3;i++) num[i]=Integer.parseInt(x[i]);
		Calendar res=Calendar.getInstance();
		res.set(num[0],num[1]-1,num[2]);
		return res;
	}
	public static void main(String[] args) {
		Calendar a=get(),b=get();
		int ans=0;
		while(true) {
			ans++;
			int k=d.compare(a, b);
			if(k<0) a.add(Calendar.DAY_OF_MONTH, 1);
			else if(k>0) b.add(Calendar.DAY_OF_MONTH, 1);
			else {ans--;break;}
		}
		System.out.println(ans);
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class B304 {

	class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader() throws FileNotFoundException{
			reader = new BufferedReader(new FileReader("d:/input.txt"));
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}
	}

	public void run(){

		InputReader reader = new InputReader(System.in);
		String start = reader.next();
		String end = reader.next();
		SimpleDateFormat sdf= new SimpleDateFormat("yyyy:MM:dd");
		sdf.setTimeZone(TimeZone.getTimeZone("GMT-0:00"));
		Date dt1 , dt2;
		try {
			dt1 = sdf.parse(start);
			dt2 = sdf.parse(end);
			long s = dt1.getTime()/(60*60*24*1000);
			long e = dt2.getTime()/(60*60*24*1000);
			long tt = Math.abs(s-e);
			System.out.println(tt);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		new B304().run();
	}

}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class B304 {

    public BufferedReader in;
    public StringTokenizer tok;

    public String nextString() throws Exception{
        while(!tok.hasMoreElements()){
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public int nextInt() throws Exception{
        return Integer.parseInt(nextString());
    }

    public void init() throws Exception{
        in = new BufferedReader(new InputStreamReader(System.in));
        tok = new StringTokenizer("");
        solve();
    }
    public int getAllV(int st, int en){
        int res = 0;
        for (int i = st; i <= en; i++) {
            if (i%4 == 0){
                if (i%100 == 0){
                    if (i%400 == 0) res++;
                } else res++;
            }
        }
        return res;
    }

    public int monthDays(int ms,int me, int ys,int ye){
        int days = 0;
        for (int k = ys; k < ye; k++) {
            if (k%4 == 0){
                if (k%100 == 0){
                    if (k%400 == 0) days++;
                } else days++;
            }

            for (int i = 1; i <= 12; i++) {
                if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
                 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                    else days += 28;
            }
        }
        for (int i = ms; i <= me; i++) {
            if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
             else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                else days += 28;
        }
        return days;
    }

    public void solve() throws Exception{
        String d1 = nextString();
        String d2 = nextString();
        String tmp;
        int pldays= 0;
        int year1,year2;
        int month1,month2;
        int day1,day2;

        year1 = Integer.valueOf(d1.substring(0,4));
        year2 = Integer.valueOf(d2.substring(0,4));
        if (year1 > year2) {
            tmp = d1;
            d1 = d2;
            d2 = tmp;
        }
        /*month1 = Integer.valueOf(start.substring(5,7));
        month2 = Integer.valueOf(finish.substring(5,7));
        day1 = Integer.valueOf(start.substring(8,10));
        day2 = Integer.valueOf(finish.substring(8,10));

        if (year1 > year2){
            year2 = Integer.valueOf(start.substring(0,4));
            year1 = Integer.valueOf(finish.substring(0,4));
            month2 = Integer.valueOf(start.substring(5,7));
            month1 = Integer.valueOf(finish.substring(5,7));
            day2 = Integer.valueOf(start.substring(8,10));
            day1 = Integer.valueOf(finish.substring(8,10));
        }

        //year1 = ((year2-year1)*12)-1;
    */

        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d1);
            date2 = format.parse(d2);
        } catch (Exception e) {

        }

        long difference = date2.getTime()-date1.getTime();
        double days = difference / (86400000.0);
        //if(days==1578)
        //  System.out.println(difference);
        System.out.println(Math.abs(Math.round(days)));

        /*
        day1 = Math.abs(day2-day1);
        System.out.println((monthDays(month1,month2,year1,year2)));
        */
    }

    public static void main(String[] args) throws Exception {
        new B304().init();
    }

}

import java.util.GregorianCalendar;
import java.util.Scanner;

/**
 *
 * @author lstr
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String F1[] = sc.nextLine().split(":");
        String F2[] = sc.nextLine().split(":");
        if(Integer.parseInt(F1[0])>Integer.parseInt(F2[0])||(Integer.parseInt(F1[0])==Integer.parseInt(F2[0])&&Integer.parseInt(F1[1])>=Integer.parseInt(F2[1]))||( Integer.parseInt(F1[0])==Integer.parseInt(F2[1])&&Integer.parseInt(F1[1])==Integer.parseInt(F2[0])&& Integer.parseInt(F1[2])>Integer.parseInt(F2[2]))){
            String y=(F1[0]),m=(F1[1]),d=(F1[2]);
            F1[0]=F2[0];F1[1]=F2[1];F1[2]=F2[2];
            F2[0]=y;F2[1]=m;F2[2]=d;
        }

        boolean yy=Integer.parseInt(F1[0])==Integer.parseInt(F2[0]);
        boolean mm=Integer.parseInt(F1[1])==Integer.parseInt(F2[1]);
        boolean dd=Integer.parseInt(F1[2])==Integer.parseInt(F2[2]);

        GregorianCalendar gc=new GregorianCalendar(Integer.parseInt(F1[0]), Integer.parseInt(F1[1]), Integer.parseInt(F1[2]));
        GregorianCalendar gc2=new GregorianCalendar(Integer.parseInt(F2[0]), Integer.parseInt(F2[1]), Integer.parseInt(F2[2]));
        int days[]={31,28,31,30,31,30,31,31,30,31,30,31};
        int totDays=0;
        for (int i = Integer.parseInt(F1[0])+1; i < Integer.parseInt(F2[0]); i++){
            totDays+=(new GregorianCalendar().isLeapYear(i))?366:365;
        }
        int mes=Integer.parseInt(F1[1]);
        int dias=days[mes-1]-Integer.parseInt(F1[2]);
        totDays+=dias;
        days[1]=(new GregorianCalendar().isLeapYear(Integer.parseInt(F1[0])))?29:28;
        for (int i = mes; i < 12; i++)
            totDays+=days[i];
        days[1]=(new GregorianCalendar().isLeapYear(Integer.parseInt(F2[0])))?29:28;
        mes=Integer.parseInt(F2[1]);
        dias=days[mes-1]-Integer.parseInt(F2[2]);
        totDays-=dias;
        for (int i = 0; i < mes; i++){
            totDays+=days[i];
        }
        if(yy)
            if(mm){
                System.out.println(Math.abs(Integer.parseInt(F2[2])-Integer.parseInt(F1[2])));
                return;
            }else{
                int r=days[Integer.parseInt(F1[1])-1]-Integer.parseInt(F1[2])+Integer.parseInt(F2[2]);
//                System.out.println("r es "+r);
                for (int i = Integer.parseInt(F1[1]); i < Integer.parseInt(F2[1])-1; i++) {
                    r+=days[i];
//                    System.out.println(i+"->"+days[i]);
                }
                System.out.println(r);
                return;
        }
        System.out.println(totDays);
    }
}

import java.util.Scanner;

public class Main {
    Scanner scan=new Scanner(System.in);
    public void doIt(){
        String s = scan.next();
        String e = scan.next();
        String [] start = s.split(":");
        String [] end = e.split(":");

        int sy = Integer.parseInt(start[0]);
        int sm = Integer.parseInt(start[1]);
        int sd = Integer.parseInt(start[2]);
        int ey = Integer.parseInt(end[0]);
        int em = Integer.parseInt(end[1]);
        int ed = Integer.parseInt(end[2]);

        int sum1 = setyear(sy);
        int sum2 = setyear(ey);

        sum1 += setmonth(sm);
        sum2 += setmonth(em);

        if(sm > 2  && intercalary(sy))sum1++;
        if(em > 2  && intercalary(ey))sum2++;

        sum1 += sd;
        sum2 += ed;

        System.out.println(Math.abs(sum2-sum1));

    }

    public int setyear(int y){
        int sum=0;
        for(int i=1900; i<y; i++){
            int set = 365;
            if(intercalary(i))set = 366;
            sum += set;
        }
        return sum;
    }
    public int setmonth(int d){
        int [] month = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        int sum=0;
        for(int i=1; i<d; i++){
            sum += month[i];
        }
        return sum;
    }

    public boolean intercalary(int y){
        if((y % 4 == 0) && ((y % 100 == 0 && y % 400 == 0) || (y % 100 != 0))){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        Main obj = new Main();
        obj.doIt();
    }

}

import java.util.*;

public class BB {

	public static void main(String args[]){

		String a, b;
		Scanner sc = new Scanner(System.in);
		a = sc.nextLine();
		b = sc.nextLine();
		sc.close();
		int y1 = Integer.parseInt(a.substring(0, 4));
		int m1 = Integer.parseInt(a.substring(5, 7));
		int d1 = Integer.parseInt(a.substring(8, 10));
		int y2 = Integer.parseInt(b.substring(0, 4));
		int m2 = Integer.parseInt(b.substring(5, 7));
		int d2 = Integer.parseInt(b.substring(8, 10));
		Calendar a1 = new GregorianCalendar(y1, m1-1, d1), b1 = new GregorianCalendar(y2, m2-1, d2);
		if(!a1.before(b1)){
			Calendar temp = a1;
			a1 = b1;
			b1 = temp;
		}
		int res = 0;
		for( ; a1.before(b1); a1.add(Calendar.DAY_OF_MONTH,1)) res++;
		System.out.println(res);
	}

}

//package Round_183;

import static java.lang.Math.abs;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class B {

    void solve () throws IOException {
        int y0 = in.nextInt();
        int m0 = in.nextInt();
        int d0 = in.nextInt();
        int y1 = in.nextInt();
        int m1 = in.nextInt();
        int d1 = in.nextInt();
        out.println(abs(diff(y0, m0, d0, y1, m1, d1)));
    }

    public static int julianDay (int year, int month, int day) {
        int a = (14 - month) / 12;
        int y = year + 4800 - a;
        int m = month + 12 * a - 3;
        int jdn = day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400
                - 32045;
        return jdn;
    }

    public static int diff (int y1, int m1, int d1, int y2, int m2, int d2) {
        return julianDay(y1, m1, d1) - julianDay(y2, m2, d2);
    }

    String input = "";
    String output = "";

    FastScanner in;
    PrintWriter out;

    void run () {
        try {
            BufferedReader bf;
            if (input.length() == 0)
                bf = new BufferedReader(new InputStreamReader(System.in));
            else
                bf = new BufferedReader(new FileReader(input));
            in = new FastScanner(bf);

            if (output.length() == 0)
                out = new PrintWriter(System.out);
            else
                out = new PrintWriter(new File(output));

            solve();

            out.close();
        } catch (Exception ex) {
            out.close();
            ex.printStackTrace();
        }
    }

    public static void main (String[] args) {
        new B().run();
    }

    class FastScanner {
        BufferedReader bf;
        StringTokenizer st;

        FastScanner(BufferedReader bf) {
            this.bf = bf;
        }

        String next () throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(bf.readLine(), " :");
            return st.nextToken();
        }

        int nextInt () throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong () throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble () throws IOException {
            return Double.parseDouble(next());
        }

        int[] readIntArray (int n) throws IOException {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] readLongArray (int n) throws IOException {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class B {

    public static void main(String[] args) throws IOException, ParseException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String s1 = reader.readLine(), s2 = reader.readLine();

        DateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        format.setTimeZone(TimeZone.getTimeZone("UTC+8"));
        Date date1 = format.parse(s1), date2 = format.parse(s2);
        System.out.println(Math.abs((date2.getTime() - date1.getTime())) / (24*3600*1000L));
    }

}

import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String d1 = sc.nextLine();
		String d2 = sc.nextLine();
		String[] p1 = d1.split(":");
		String[] p2 = d2.split(":");
		solve(Integer.parseInt(p1[0]),Integer.parseInt(p1[1]),Integer.parseInt(p1[2]) ,
		Integer.parseInt(p2[0]),Integer.parseInt(p2[1]),Integer.parseInt(p2[2]));

	}

	public static void solve(int y1,int m1,int d1,int y2,int m2,int d2) {

		MyDate dat1 = new MyDate(y1,m1,d1);
		MyDate dat2 = new MyDate(y2,m2,d2);
		System.out.println((dat1.getDays(dat2)-1));
	}

}

class MyDate {
	int year;
	int month;
	int day;

	public MyDate(int y,int m,int d) {
		year = y;
		month = m-1;
		day = d;
	}

	public int getDays(MyDate other) {

		if(this.compareTo(other)==0) {
			return 1;
		}
		MyDate smaller = this.compareTo(other)<0?this:other;
		MyDate larger = this.compareTo(other)>0?this:other;

		if(smaller.month == larger.month && smaller.year==larger.year) {
			return larger.day - smaller.day + 1;
		}

		int[] days = {31,28,31,30,31,30,31,31,30,31,30,31};

		int curMonth = smaller.month+1;
		int curYear= smaller.year;
		if(curMonth==12) {
			curMonth = 0;
			curYear++;
		}

		int finMonth = larger.month-1;
		int finYear = larger.year;
		if(finMonth == -1) {
			finMonth = 11;
			finYear --;
		}

		int numDays = 0;

		while((curYear==finYear && curMonth<=finMonth) || (curYear<finYear)) {

			if(curMonth==1 && (curYear%4==0 && (curYear%100!=0 || curYear%400==0))) {
				numDays+=29;
			}
			else {
				numDays+=days[curMonth];
			}
			curMonth++;
			if(curMonth==12) {
				curMonth = 0;
				curYear++;
			}
		}

		boolean isSmallerLeap = (smaller.year%4==0 && (smaller.year%100!=0 || smaller.year%400==0));
		int smallerDays = smaller.month==1 && isSmallerLeap ? days[smaller.month]+1:days[smaller.month];
		return numDays + (smallerDays-smaller.day+1) + (larger.day);

	}

	public int compareTo(MyDate other) {
		if(year!=other.year)return year<other.year?-1:1;
		if(month!=other.month)return month<other.month?-1:1;
		if(day!=other.day)return day<other.day?-1:1;
		return 0;
	}
}

import java.io.*;
import java.util.*;

public class z3 {
	private static Scanner in;
	static int[] me={31,28,31,30,31,30,31,31,30,31,30,31};
	static int isv(int y) {
		if ((y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0)))
			return 1;
		else
			return 0;
	}
    static int day(int y,int m,int d) {
    	int f=365*y;
    	for (int i=1899;i<y;i++) f+=isv(i);
    	for (int i=1;i<m;i++) {
    		f+=me[i-1];
    		if ((i==2)&&(isv(y)==1)) f++;
    	}
    	f+=d;
    	return f;
    }
	public static void main(String[] args) throws IOException {
		in = new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        int y1=Integer.parseInt(s1.substring(0,4));
        int m1=Integer.parseInt(s1.substring(5,7));
        int d1=Integer.parseInt(s1.substring(8,10));
        int y2=Integer.parseInt(s2.substring(0,4));
        int m2=Integer.parseInt(s2.substring(5,7));
        int d2=Integer.parseInt(s2.substring(8,10));
        System.out.println(Math.abs(day(y1,m1,d1)-day(y2,m2,d2)));
	}
}

import java.io.PrintWriter;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class Main {
    public static void main(String[] arg)
    {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String[] s = new String[2];
        for (int i = 0; i < 2; ++i)
        {
            s[i] = in.nextLine();
        }
        int [] year = new int[2];
        int [] mon = new int[2];
        int [] day = new int[2];
        Calendar[] a = new Calendar[2];

        for (int i = 0; i < 2; ++i)
        {
            year[i] = Integer.parseInt(s[i].substring(0, 4));
            mon[i] = Integer.parseInt(s[i].substring(5, 7));
            day[i] = Integer.parseInt(s[i].substring(8, 10));

            //out.println( year[i] + " " + mon[i] + " " + day[i]);
            a[i] = new GregorianCalendar(year[i], mon[i] - 1, day[i]);
        }
        if (a[1].before(a[0]))
        {
            Calendar cur = a[1];
            a[1] = a[0];
            a[0] = cur;
        }

        int ans = 0;
        while (a[0].compareTo(a[1]) < 0)
        {
            ans++;
            a[0].add(Calendar.DATE, 1);
        }
        out.println(ans);
        out.flush();
    }
}

import java.io.*;
import java.util.*;
import java.text.*;

public class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(new InputStreamReader(System.in));
        PrintWriter out=new PrintWriter(System.out);
        String d1 = in.nextLine();
        String d2 = in.nextLine();
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        format.setTimeZone(TimeZone.getTimeZone("UTC"));
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d2);
            date2 = format.parse(d1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        long difference = date1.getTime() - date2.getTime();

        long days = difference / (24 * 60 * 60 * 1000);
        out.println(Math.abs(days));

        in.close();
        out.close();
    }

}

import java.lang.*;
import java.util.*;
import java.io.*;

public class TaskD {

    int[] parse() throws IOException {
        int[] a = new int[3];
        String s = in.nextToken();
        a[0] = Integer.parseInt(s.substring(0, 4));
        a[1] = Integer.parseInt(s.substring(5, 7));
        a[2] = Integer.parseInt(s.substring(8, 10));
        return a;
    }

    public static final int[] d = new int[] {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    void next(int[] a) {
        int days = d[a[1] - 1];
        if (days == 28 && isLeap(a[0])) {
            ++days;
        }
        if (days > a[2]) {
            ++a[2];
        } else {
            a[2] = 1;
            if (a[1] == 12) {
                a[1] = 1;
                ++a[0];
            } else {
                ++a[1];
            }
        }
    }

    boolean isLeap(int x) {
        return (x % 4 == 0 && x % 100 != 0 || x % 400 == 0);
    }

    void solve() throws IOException {
        int[] a = parse();
        int[] b = parse();
        int ans = 0;
        boolean swap = a[0] > b[0];
        swap |= a[0] == b[0] && a[1] > b[1];
        swap |= a[0] == b[0] && a[1] == b[1] && a[2] > b[2];
        if (swap) {
            int[] tmp = a;
            a = b;
            b = tmp;
        }
//        err.println(a[0] + " " + a[1] + " " + a[2]);
//        err.println(b[0] + " " + b[1] + " " + b[2]);
//        if (true) return;
        while (a[0] < b[0] - 3) {
            ans += 365;
            int x = a[0];
            if (a[1] > 2) ++x;
            if (isLeap(x)) {
                ++ans;
            }
            ++a[0];
        }
//        err.println(a[0] + " " + a[1] + " " + a[2]);
//        err.println(b[0] + " " + b[1] + " " + b[2]);
        while (a[0] != b[0] || a[1] != b[1] || a[2] != b[2]) {
            ++ans;
            next(a);
//            err.println(a[0] + " " + a[1] + " " + a[2]);
        }
        out.println(ans);
    }

    static FastReader in;
    static PrintWriter out;
    static PrintStream err;

    public static void main(String[] args) throws IOException {
        try {
            in = new FastReader();
            out = new PrintWriter(System.out);
            err = System.err;
            new TaskD().solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

}

class FastReader {
    private StringTokenizer st;
    private BufferedReader br;

    public FastReader() {
        this(System.in);
    }

    public FastReader(InputStream ps) {
        br = new BufferedReader(new InputStreamReader(ps));
    }

    public FastReader(String filename) throws FileNotFoundException {
        this(new FileInputStream(filename));
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreElements()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
}

import java.util.*;
import java.io.*;

public class B304 {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		StringTokenizer st = new StringTokenizer(sc.next(), ":");
		GregorianCalendar d1 = new GregorianCalendar(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()) - 1, Integer.parseInt(st.nextToken()));
		st = new StringTokenizer(sc.next(), ":");
		GregorianCalendar d2 = new GregorianCalendar(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()) - 1, Integer.parseInt(st.nextToken()));
		d1.setTimeZone(TimeZone.getTimeZone("Cairo"));
		d2.setTimeZone(TimeZone.getTimeZone("Cairo"));
		pw.println(Math.abs(d1.getTimeInMillis() - d2.getTimeInMillis()) / 86400000l);
		pw.flush();
	}

	public static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = nextInt();
			return array;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] array = new Integer[n];
			for (int i = 0; i < n; i++)
				array[i] = new Integer(nextInt());
			return array;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++)
				array[i] = nextLong();
			return array;
		}

		public double[] nextDoubleArray(int n) throws IOException {
			double[] array = new double[n];
			for (int i = 0; i < n; i++)
				array[i] = nextDouble();
			return array;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
import java.util.stream.*;
import java.lang.management.*;
import static java.lang.Math.*;

@SuppressWarnings("unchecked")
public class P0304B {

  public void run() throws Exception {
    DateFormat df = new SimpleDateFormat("yyyy:MM:dd");
    long diff = abs(df.parse(next()).getTime() - df.parse(next()).getTime());
    println((int)round(diff / 86_400_000.0));
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P0304B().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
    long gct = 0, gcc = 0;
    for (GarbageCollectorMXBean garbageCollectorMXBean : ManagementFactory.getGarbageCollectorMXBeans()) {
      gct += garbageCollectorMXBean.getCollectionTime();
      gcc += garbageCollectorMXBean.getCollectionCount();
    }
    System.err.println("[GC time : " + gct + " ms, count = " + gcc + "]");
    System.err.println("[JIT time : " + ManagementFactory.getCompilationMXBean().getTotalCompilationTime() + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void printsp(int [] a) { for (int i = 0, n = a.length; i < n; print(a[i] + " "), i++); }
  void printsp(long [] a) { for (int i = 0, n = a.length; i < n; print(a[i] + " "), i++); }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }

  int gcd(int a, int b) {
    if (a == 0) return Math.abs(b); if (b == 0) return Math.abs(a);
    a = Math.abs(a); b = Math.abs(b);
    int az = Integer.numberOfTrailingZeros(a), bz = Integer.numberOfTrailingZeros(b);
    a >>>= az; b >>>= bz;
    while (a != b) {
      if (a > b) { a -= b; a >>>= Integer.numberOfTrailingZeros(a); }
            else { b -= a; b >>>= Integer.numberOfTrailingZeros(b); }
    }
    return (a << Math.min(az, bz));
  }

  long gcd(long a, long b) {
    if (a == 0) return Math.abs(b); if (b == 0) return Math.abs(a);
    a = Math.abs(a); b = Math.abs(b);
    int az = Long.numberOfTrailingZeros(a), bz = Long.numberOfTrailingZeros(b);
    a >>>= az; b >>>= bz;
    while (a != b) {
      if (a > b) { a -= b; a >>>= Long.numberOfTrailingZeros(a); }
            else { b -= a; b >>>= Long.numberOfTrailingZeros(b); }
    }
    return (a << Math.min(az, bz));
  }

  boolean isPrime(int v) {
    if (v <= 1) { return false; }
    if (v <= 3) { return true; }
    if (((v & 1) == 0) || ((v % 3) == 0)) { return false; }
    for (int m = 5, n = (int)sqrt(v); m <= n; m += 6) { if (((v % m) == 0) || ((v % (m + 2)) == 0)) { return false; } }
    return true;
  }

  int [] rshuffle(int [] a) { // RANDOM shuffle
    Random r = new Random();
    for (int i = a.length - 1, j, t; i >= 0; j = r.nextInt(a.length), t = a[i], a[i] = a[j], a[j] = t, i--);
    return a;
  }

  int [] qshuffle(int [] a) { // QUICK shuffle
    int m = new Random().nextInt(10) + 2;
    for (int i = 0, n = a.length, j = m % n, t; i < n; t = a[i], a[i] = a[j], a[j] = t, i++, j = (i * m) % n);
    return a;
  }

  long [] shuffle(long [] a) {
    Random r = new Random();
    for (int i = a.length - 1; i >= 0; i--) {
      int j = r.nextInt(a.length);
      long t = a[i]; a[i] = a[j]; a[j] = t;
    }
    return a;
  }

  void shuffle(Object [] a) {
    Random r = new Random();
    for (int i = a.length - 1; i >= 0; i--) {
      int j = r.nextInt(a.length);
      Object t = a[i]; a[i] = a[j]; a[j] = t;
    }
  }

  int [] sort(int [] a) {
    final int SHIFT = 16, MASK = (1 << SHIFT) - 1, SIZE = (1 << SHIFT) + 1;
    int n = a.length, ta [] = new int [n], ai [] = new int [SIZE];
    for (int i = 0; i < n; ai[(a[i] & MASK) + 1]++, i++);
    for (int i = 1; i < SIZE; ai[i] += ai[i - 1], i++);
    for (int i = 0; i < n; ta[ai[a[i] & MASK]++] = a[i], i++);
    int [] t = a; a = ta; ta = t;
    ai = new int [SIZE];
    for (int i = 0; i < n; ai[(a[i] >> SHIFT) + 1]++, i++);
    for (int i = 1; i < SIZE; ai[i] += ai[i - 1], i++);
    for (int i = 0; i < n; ta[ai[a[i] >> SHIFT]++] = a[i], i++);
    return ta;
  }

  void flush() {
    pw.flush();
  }

  void pause() {
    flush(); System.console().readLine();
  }
}

import java.util.Date;
import java.text.SimpleDateFormat;
import java.io.OutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.io.UnsupportedEncodingException;
import java.util.InputMismatchException;
import java.util.Calendar;
import java.text.DateFormat;
import java.text.ParseException;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Fabian Conejo @FabianConP
 */
public class Main {
    public static void main(String[] args) throws ParseException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) throws ParseException {
        Calendar[] cal = new Calendar[2];
        cal[0] = Calendar.getInstance();
        cal[1] = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");
        try {
            cal[0].setTime(sdf.parse(in.readLine()));
            cal[1].setTime(sdf.parse(in.readLine()));
        }catch (ParseException e){
        }
        Arrays.sort(cal);
        long countDays = 0;
        while(cal[0].compareTo(cal[1])<0){
            countDays++;
            cal[0].add(Calendar.DATE, 1);
        }
        out.printLine(countDays);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    }

class OutputWriter {
    private final OutputStream out;

    public OutputWriter(OutputStream outputStream) {
        out = outputStream;
    }

    public void print(Object...objects) {
        try {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    out.write(' ');
                out.write(objects[i].toString().getBytes("UTF-8"));
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        try {
            out.write('\n');
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void close() {
        try {
            out.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    }

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.StringTokenizer;

public class kok {

	static int[] nonLeap = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	static int[] leap = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	static boolean isLeap(int year){

		if(year % 4 != 0)
			return false;

		if(year % 100 == 0 && year % 400 != 0)
			return false;

		return true;
	}

	static int getDays(int year, int month, int day){
		int currYear = 0;
		int res = 0;

		while(currYear < year){
			if(isLeap(currYear))
				res += 366;
			else
				res += 365;

			currYear ++;
		}

		if(isLeap(year))
			for(int i = 0; i < month - 1; i++)
				res += leap[i];
		else
			for(int i = 0; i < month - 1; i++)
				res += nonLeap[i];

		res += day;

		return res;
	}

	public static void main(String[] args) throws IOException {
		FastReader sc = new FastReader(System.in);

		String first = sc.next();
		String second = sc.next();

		String[] split = first.split(":");

		int y1 = Integer.parseInt(split[0]);
		int m1 = Integer.parseInt(split[1]);
		int d1 = Integer.parseInt(split[2]);

		split = second.split(":");

		int y2 = Integer.parseInt(split[0]);
		int m2 = Integer.parseInt(split[1]);
		int d2 = Integer.parseInt(split[2]);

		System.out.println(Math.abs(getDays(y1, m1, d1) - getDays(y2, m2, d2)));

  }

}

class FastReader {
	public BufferedReader reader;
    public StringTokenizer tokenizer;

    public FastReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() throws IOException{
        return Integer.parseInt(next());
    }
     public long nextL() throws IOException{
        return Long.parseLong(next());
    }
}

import java.util.GregorianCalendar;
import java.util.Scanner;
import java.util.StringTokenizer;

public class BB {

	static boolean leap(int year) {
		return ((year % 400) == 0)
				|| (((year % 100) != 0) && ((year % 4) == 0));
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringTokenizer to = new StringTokenizer(sc.nextLine(), ":");
		int y1 = Integer.parseInt(to.nextToken()), m1 = Integer.parseInt(to
				.nextToken()), d1 = Integer.parseInt(to.nextToken());
		to = new StringTokenizer(sc.nextLine(), ":");
		int y2 = Integer.parseInt(to.nextToken()), m2 = Integer.parseInt(to
				.nextToken()), d2 = Integer.parseInt(to.nextToken());
		long out = 0;
		int yn, yx, mn, mx, dn, dx;
		if (y1 < y2 || (y1 == y2 && m1 < m2)
				|| (y1 == y2 && m1 == m2 && d1 <= d2)) {
			yn = y1;
			yx = y2;
			mn = m1;
			mx = m2;
			dn = d1;
			dx = d2;
		} else {
			yn = y2;
			yx = y1;
			mn = m2;
			mx = m1;
			dn = d2;
			dx = d1;
		}
		for (int i = yn + 1; i < yx; i++) {
			if (leap(i))
				out += 366;
			else
				out += 365;
		}
		int[] mon = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		if (y1 != y2) {
			for (int i = mn; i < mon.length; i++) {
				out += mon[i];
				if (i == 1 && leap(yn))
					out++;
			}
			for (int i = 0; i < mx - 1; i++) {
				out += mon[i];
				if (i == 1 && leap(yx))
					out++;
			}
			// if (y1 == yn && m1 == mn && d1 == dn) {
			out += mon[mn - 1] - dn;
			out += dx - 1;
			out++;
			// } else {
			// out += mon[m2 - 1] - d2 + 1;
			// out += d1 - 1;
			// }
			if (mn == 2 && leap(yn))
				out++;
		} else {
			for (int i = mn; i < mx - 1; i++) {
				out += mon[i];
				if (i == 1 && leap(yn))
					out++;
			}
			if (mn != mx) {
				out += mon[mn - 1] - dn;
				out += dx - 1;
				out++;
				if (mn == 2 && leap(yn))
					out++;
			} else {
				out += dx - dn;
			}
		}
		// if (mx == 2 && leap(yx))
		// out++;
		System.out.println(out);
	}
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Locale;
import java.util.StringTokenizer;

public class bxn {

	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));
		String s1 = next();
		String s2 = next();
		int n1 = Integer.parseInt(s1.substring(0, 4));
		int n2 = Integer.parseInt(s2.substring(0, 4));
		int m1 = Integer.parseInt(s1.substring(5, 7));
		int m2 = Integer.parseInt(s2.substring(5, 7));
		int k1 = Integer.parseInt(s1.substring(8, 10));
		int k2 = Integer.parseInt(s2.substring(8, 10));
		if (n2 < n1 || (n1 == n2 && m2 < m1)
				|| (n1 == n2 && m1 == m2 && k2 < k1)) {
			int p = n1;
			n1 = n2;
			n2 = p;
			p = m1;
			m1 = m2;
			m2 = p;
			p = k1;
			k1 = k2;
			k2 = p;
		}
		int ans = 0;
		int d1[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		int d2[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		while (true) {
			if (n1 == n2 && m1 == m2 && k1 == k2)
				break;
			k1++;
			if ((n1 % 4 == 0 && n1 % 100 != 0) || n1 % 400 == 0) {
				if (d1[m1 - 1] < k1) {
					k1 = 1;
					m1++;
				}
			} else {
				if (d2[m1 - 1] < k1) {
					k1 = 1;
					m1++;
				}
			}
			if (m1 == 13) {
				m1 = 1;
				n1++;
			}
			ans++;
		}
		System.out.println(ans);
		pw.close();
	}

	private static int nexInt() throws IOException {
		return Integer.parseInt(next());
	}

	private static byte nexByte() throws IOException {
		return Byte.parseByte(next());
	}

	private static long nexLong() throws IOException {
		return Long.parseLong(next());
	}

	private static double nexDouble() throws IOException {
		return Double.parseDouble(next());
	}

	private static String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class B {
	static int[] NUM_DAYS = new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31};
	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		String start = sc.nextToken();
		String end = sc.nextToken();

		String[] sToks = start.split(":");
		String[] eToks = end.split(":");

		int sy = Integer.parseInt(sToks[0]);
		int sm = Integer.parseInt(sToks[1]);
		int sd = Integer.parseInt(sToks[2]);

		int ey = Integer.parseInt(eToks[0]);
		int em = Integer.parseInt(eToks[1]);
		int ed = Integer.parseInt(eToks[2]);

		int count = 0;

		if(!(sy < ey || (sy==ey && sm<em) || (sy==ey && sm==em && sd<ed))){
			ey = Integer.parseInt(sToks[0]);
			em = Integer.parseInt(sToks[1]);
			ed = Integer.parseInt(sToks[2]);

			sy = Integer.parseInt(eToks[0]);
			sm = Integer.parseInt(eToks[1]);
			sd = Integer.parseInt(eToks[2]);

		}

		while(sy < ey || (sy==ey && sm<em) || (sy==ey && sm==em && sd<ed)){
			int numDay = NUM_DAYS[sm];

			if(sm == 2 && sy % 4 == 0 && !(sy % 100 == 0 && sy % 400 != 0)){
				numDay = 29;
			}

			sd++;
			count++;
			if(sd > numDay){
				sm++;
				sd = 1;
				if(sm == 13){
					sy++;
					sm = 1;
				}
			}
		}
		System.out.println(count);
	}

	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}
}

import java.util.Date;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.text.DateFormat;
import java.text.ParseException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nguyen Trung Hieu - vuondenthanhcong11@gmail.com
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy:MM:dd");
        Date from = new Date();
        Date to = new Date();
        try {
            from = dateFormat.parse(in.readString());
            to = dateFormat.parse(in.readString());
        } catch (ParseException e) {
            e.printStackTrace();
        }

        int answer = 0;
        if (from.compareTo(to) > 0) {
            Date temp = from;
            from = to;
            to = temp;
        }
        while (from.compareTo(to) < 0) {
            from.setDate(from.getDate() + 1);
            answer++;
        }

        out.printLine(answer);
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)   throws Exception {

		BufferedReader br =  new BufferedReader(new InputStreamReader(System.in));
		// TODO Auto-generated method stub
		String line[];
		int aa , mm , dd ;
		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]) - 1;
		dd = Integer.parseInt(line[2]);

		GregorianCalendar a =  new GregorianCalendar(aa , mm , dd);
		a.setTimeZone(TimeZone.getTimeZone("GMT"));
		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]) - 1;
		dd = Integer.parseInt(line[2]);
		GregorianCalendar b =  new GregorianCalendar(aa , mm, dd);
		b.setTimeZone(TimeZone.getTimeZone("GMT"));
		 long  res  =   Math.abs(a.getTimeInMillis() - b.getTimeInMillis());
		 b =  new GregorianCalendar();

		long z =  (res /(86400000));

		 System.out.println(z);

	}

}

import java.awt.Point;
import java.util.regex.*;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;
import java.util.Random;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import static java.lang.Math.*;

public class Solve implements Runnable{

final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException{
        if (ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");

        }
    }

    String readString() throws IOException{
        while(!tok.hasMoreTokens()){
            try{
                tok = new StringTokenizer(in.readLine());
            }catch (Exception e){
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException{
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException{
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException{
        return Double.parseDouble(readString());
    }

    public static void main(String[] args){
        new Thread(null, new Solve(), "", 256 * (1L << 20)).start();
    }

    long timeBegin, timeEnd;

    void time(){
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    void debug(Object... objects){
        if (!ONLINE_JUDGE){
            for (Object o: objects){
                System.err.println(o.toString());
            }
        }
    }

    int sm(int x){
        if (x==1) return 0;else return 1;
    }

    static int gcd(int a,int b){
        if (b==0) return a;
        else{
            return gcd(b,a%b);
        }
    }

    public int cont(String st1,String st2) throws IOException{

            String st3="1";
            if (st2.length()>1){
                st3+=st2.substring(1);
            }
            int count=0;
            int j=0;
            while (st1.indexOf(st2)>=0){
                j++;
                if (j>1000) break;
                st1=st1.replaceFirst(st2, st3);
                count++;
            }
            return count;
    }
    public int cont1(String st1,String st2) throws IOException{
        int len=st1.length();
        String st3="";
        if (st2.length()>1){
            st3+=st2.substring(1);
        }
        st1=st1.replaceAll(st2, st3);
        int len1=st1.length();
        int count=len-len1;

        return count;
}

    public void solve() throws IOException, ParseException{

        String s1=readString();
        String s2=readString();
        SimpleDateFormat ft = new SimpleDateFormat("yyyy:MM:dd");
        ft.setTimeZone(TimeZone.getTimeZone("UTC"));
        Date d1=ft.parse(s1);
        Date d2=ft.parse(s2);
        long start=d1.getTime()/(3600*24*1000);
        long end=d2.getTime()/(3600*24*1000);
        out.println(Math.abs(start-end));

    }

    public void run(){
        try{
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        }catch (Exception e){
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

}

import java.io.*;
import java.util.*;
import java.math.*;

final public class Main implements Runnable {
	private static boolean local;

	public static void main(String[] args) {
		if (args.length > 0 && args[0].equals("local")) {
			local = true;
		}
		new Thread(null, new Main(), "mainthread", 1 << 27).start();
	}

	public void run() {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;

		try {
			if (local) {
				inputStream = new FileInputStream("X:/coding/workspace/java/main/io/input.txt");
				outputStream = new FileOutputStream("X:/coding/workspace/java/main/io/output.txt");
			} else {
				// inputStream = new FileInputStream("input.txt");
				// outputStream = new FileOutputStream("output.txt");
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

		Task solver = new Task();
		solver.in = new InputReader(inputStream);
		solver.out = new OutputWriter(outputStream);
		if (local) {
			solver.dout = new DebugWriter(solver.out);
		}
		solver.solve();
		solver.out.close();
	}
}

final class Task {
	public InputReader in;
	public OutputWriter out;
	public DebugWriter dout;

	void err() {
		System.err.println("err");
	}

	void err(String s) {
		System.err.println(s);
	}

	public void solve() {
		String[] s1 = in.readString().split(":");
		String[] s2 = in.readString().split(":");

		int y1 = Integer.valueOf(s1[0]);
		int y2 = Integer.valueOf(s2[0]);

		int m1 = Integer.valueOf(s1[1]);
		int m2 = Integer.valueOf(s2[1]);

		int d1 = Integer.valueOf(s1[2]);
		int d2 = Integer.valueOf(s2[2]);

		DateValue date1 = new DateValue(y1, m1, d1);
		DateValue date2 = new DateValue(y2, m2, d2);

		// dout.printLine(date1);
		// dout.printLine(date2);

		int value = Math.abs(date1.asInt() - date2.asInt());

		out.printLine(value);

	}
}

final class InputReader {
	private boolean finished = false;

	private InputStream stream;
	private byte[] buf = new byte[1 << 13];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	private int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int peek() {
		if (numChars == -1)
			return -1;
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				return -1;
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long readLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public static boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private String readLine0() {
		StringBuilder buf = new StringBuilder();
		int c = read();
		while (c != '\n' && c != -1) {
			if (c != '\r')
				buf.appendCodePoint(c);
			c = read();
		}
		return buf.toString();
	}

	public String readLine() {
		String s = readLine0();
		while (s.trim().length() == 0)
			s = readLine0();
		return s;
	}

	public String readLine(boolean ignoreEmptyLines) {
		if (ignoreEmptyLines)
			return readLine();
		else
			return readLine0();
	}

	public String readToEnd() {
		StringBuilder buf = new StringBuilder();
		int c = read();
		while (c != -1) {
			if (c != '\r')
				buf.appendCodePoint(c);
			c = read();
		}
		return buf.toString();
	}

	public BigInteger readBigInteger() {
		try {
			return new BigInteger(readString());
		} catch (NumberFormatException e) {
			throw new InputMismatchException();
		}
	}

	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}

	public double readDouble() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		double res = 0;
		while (!isSpaceChar(c) && c != '.') {
			if (c == 'e' || c == 'E')
				return res * Math.pow(10, readInt());
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		}
		if (c == '.') {
			c = read();
			double m = 1;
			while (!isSpaceChar(c)) {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, readInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				m /= 10;
				res += (c - '0') * m;
				c = read();
			}
		}
		return res * sgn;
	}

	public boolean isExhausted() {
		int value;
		while (isSpaceChar(value = peek()) && value != -1)
			read();
		return value == -1;
	}

	public void close() {
		try {
			stream.close();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}
}

final class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream), 1 << 13));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	public void print(Object... objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(Object... objects) {
		print(objects);
		writer.println();
	}

	public void printFormat(String format, Object... objects) {
		writer.printf(format, objects);
	}

	public void print(char[] objects) {
		writer.print(objects);
	}

	public void printLine(char[] objects) {
		writer.println(objects);
	}

	public void printLine(char[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(int[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(int[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(int[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(short[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(short[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(short[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(long[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(long[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(long[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(double[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(double[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(double[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(byte[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(byte[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(byte[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(boolean[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(boolean[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(boolean[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void close() {
		writer.close();
	}

	public void flush() {
		writer.flush();
	}
}

final class DebugWriter {
	private final OutputWriter writer;

	public DebugWriter(OutputWriter writer) {
		this.writer = writer;
	}

	private void printDebugMessage() {
		writer.print("DEBUG:\t");
	}

	public void printLine(Object... objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printFormat(String format, Object... objects) {
		flush();
		printDebugMessage();
		writer.printFormat(format, objects);
		flush();
	}

	public void printLine(char[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(char[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(double[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(double[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(int[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(int[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(short[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(short[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(long[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(long[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(byte[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(byte[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(boolean[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(boolean[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void flush() {
		writer.flush();
	}
}

class DateValue implements Comparable<DateValue> {
        private static final int[] DAYS_IN_MONTH = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        public static final String[] WEEKDAYS = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

        public final int year;
        public final int month;
        public final int day;
        private int weekday;

        public DateValue(int year, int month, int day) {
                this.year = year;
                this.month = month;
                this.day = day;
                weekday = -1;
        }

        public int getWeekday() {
                if (weekday == -1) {
                        weekday = asInt();
                        weekday += 6;
                        weekday %= 7;
                }
                return weekday;
        }

        public int asInt() {
                int day = (year - 1) * 365;
                day += (year - 1) / 4;
                day -= (year - 1) / 100;
                day += (year - 1) / 400;
                for (int i = 1; i < month; i++)
                        day += DAYS_IN_MONTH[i];
                day += this.day;
                if (isLeapYear(year) && month > 2)
                        day++;
                return day;
        }

        public boolean isValid() {
                return !(month > 12 || month < 1) && !(day > DAYS_IN_MONTH[month] &&
                        (day != 29 || month != 2 || !isLeapYear(year))) && day >= 1;
        }

        public DateValue next() {
                int year = this.year;
                int month = this.month;
                int day = this.day;
                day++;
                DateValue next = new DateValue(year, month, day);
                if (!next.isValid())
                        next = new DateValue(year, month + 1, 1);
                if (!next.isValid())
                        next = new DateValue(year + 1, 1, 1);
                if (weekday != -1)
                        next.weekday = (weekday + 1) % 7;
                return next;
        }

        @Override
        public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;

                DateValue date = (DateValue) o;

                return day == date.day && month == date.month && year == date.year;
        }

        @Override
        public int hashCode() {
                int result = year;
                result = 31 * result + month;
                result = 31 * result + day;
                return result;
        }

        public static DateValue parse(String date, String pattern) {
                int length = date.length();
                if (length != pattern.length())
                        throw new IllegalArgumentException();
                int year = 0;
                int month = 0;
                int day = 0;
                for (int i = 0; i < length; i++) {
                        if (Character.toUpperCase(pattern.charAt(i)) == 'Y') {
                                year *= 10;
                                year += date.charAt(i) - '0';
                        } else if (Character.toUpperCase(pattern.charAt(i)) == 'M') {
                                month *= 10;
                                month += date.charAt(i) - '0';
                        } else if (Character.toUpperCase(pattern.charAt(i)) == 'D') {
                                day *= 10;
                                day += date.charAt(i) - '0';
                        }
                }
                return new DateValue(year, month, day);
        }

        public static boolean isLeapYear(int year) {
                return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
        }

        public int compareTo(DateValue o) {
                return asInt() - o.asInt();
        }

        @Override
        public String toString() {
                return toString("DD.MM.YYYY");
        }

        public String toString(String pattern) {
                int copyYear = year;
                int copyMonth = month;
                int copyDay = day;
                StringBuilder result = new StringBuilder();
                for (int i = pattern.length() - 1; i >= 0; i--) {
                        char character = pattern.charAt(i);
                        switch (character) {
                        case 'D': case 'd':
                                result.append(copyDay % 10);
                                copyDay /= 10;
                                break;
                        case 'M': case 'm':
                                result.append(copyMonth % 10);
                                copyMonth /= 10;
                                break;
                        case 'Y': case 'y':
                                result.append(copyYear % 10);
                                copyYear /= 10;
                                break;
                        default:
                                result.append(character);
                        }
                }
                return result.reverse().toString();
        }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Calendar304 {

    public static boolean isLeapYear(int year) {
        if (year % 100 == 0 && year % 400 != 0) {
            return false;
        } else if (year % 4 == 0) {
            return true;
        } else {
            return false;
        }
    }

    public static void main(String[] args) throws Exception {
        int[] months = new int[13];
        months[0] = 365;
        months[1] = 0;
        months[2] = 31;
        months[3] = 59;
        months[4] = 90;
        months[5] = 120;
        months[6] = 151;
        months[7] = 181;
        months[8] = 212;
        months[9] = 243;
        months[10] = 273;
        months[11] = 304;
        months[12] = 334;

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] firstDate = in.readLine().split(":");
        String[] secondDate = in.readLine().split(":");

        int totaldays1, totaldays2, leapyear1, leapyear2;
        int year1, year2, month1, month2, day1, day2;
        year1 = Integer.parseInt(firstDate[0]);
        year2 = Integer.parseInt(secondDate[0]);
        month1 = Integer.parseInt(firstDate[1]);
        month2 = Integer.parseInt(secondDate[1]);
        day1 = Integer.parseInt(firstDate[2]);
        day2 = Integer.parseInt(secondDate[2]);

        totaldays1 = year1 * 365 + months[month1] + day1;
        totaldays2 = year2 * 365 + months[month2] + day2;

        if (month1 > 2) {
            leapyear1 = year1 / 4 - year1 / 100 + year1 / 400;
        } else {
            leapyear1 = (year1 - 1) / 4 - (year1 - 1) / 100 + (year1 - 1) / 400;
        }
        if (month2 > 2) {
            leapyear2 = year2 / 4 - year2 / 100 + year2 / 400;
        } else {
            leapyear2 = (year2 - 1) / 4 - (year2 - 1) / 100 + (year2 - 1) / 400;
        }

        totaldays1 += leapyear1;
        totaldays2 += leapyear2;

        int sum = Math.abs(totaldays1 - totaldays2);// + Math.abs(leapyear1);
        System.out.println(sum);

        in.close();

    }
}

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.*;
public class Main{

     public static void main(String []args){
         Scanner sc=new Scanner(System.in);
         String s1,s2;
         s1=sc.next();
         s2=sc.next();
      String dateBeforeString = s1.split(":")[0]+"-"+s1.split(":")[1]+"-"+s1.split(":")[2];
	String dateAfterString = s2.split(":")[0]+"-"+s2.split(":")[1]+"-"+s2.split(":")[2];

	//Parsing the date
	LocalDate dateBefore = LocalDate.parse(dateBeforeString);
	LocalDate dateAfter = LocalDate.parse(dateAfterString);

	//calculating number of days in between
	long noOfDaysBetween = ChronoUnit.DAYS.between(dateBefore, dateAfter);
	noOfDaysBetween =(noOfDaysBetween<0)?noOfDaysBetween*-1:noOfDaysBetween;
	//displaying the number of days
	System.out.println(noOfDaysBetween);
     }
}

import java.util.*; //Scanner, Calendar
import java.io.PrintWriter; //PrintWriter
import java.text.*;   //SimpleDateFormat

public class ND_R183_Div2_B
{
	public static void main(String[] args) {
		Scanner      in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		solve(in, out);
		out.close();
		in.close();
	}

	public static void solve(Scanner in, PrintWriter out)
	{
        String d1 = in.nextLine();
        String d2 = in.nextLine();
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        format.setTimeZone(TimeZone.getTimeZone("UTC"));
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d1);
            date2 = format.parse(d2);
        } catch (Exception e) {
            e.printStackTrace();
        }

		long diff = Math.abs(date2.getTime() - date1.getTime());
		long diffDays = diff / (24 * 60 * 60 * 1000);

		out.println(diffDays);
	}
}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.StringTokenizer;

public class CF_183_B {

    public static boolean isLeapYear(int year) {
          if (year % 4 != 0) {
            return false;
          } else if (year % 400 == 0) {
            return true;
          } else if (year % 100 == 0) {
            return false;
          } else {
            return true;
          }
        }

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        String in = sc.next();

        String[] nums = in.split(":");
        int y1 = Integer.parseInt(nums[0]);
        int m1 = Integer.parseInt(nums[1]);
        int d1 = Integer.parseInt(nums[2]);

        String in2 = sc.next();
        nums = in2.split(":");
        int y2 = Integer.parseInt(nums[0]);
        int m2 = Integer.parseInt(nums[1]);
        int d2 = Integer.parseInt(nums[2]);

        if(y1>y2 || (y1==y2 && m1>m2) || (y2==y1 && m1==m2 && d1>d2)){

            int ty = y1;
            y1 = y2;
            y2 = ty;

            int tm = m1;
            m1 = m2;
            m2 = tm;

            int td = d1;
            d1 = d2;
            d2 = td;
        }

        int count = 0;

        int days[] =  new int[] {31,28,31,30,31,30,31,31,30,31,30,31};
        int daysL[] =  new int[]{31,29,31,30,31,30,31,31,30,31,30,31};

        while(!(y1>y2 || (y1==y2 && m1>m2) || (y2==y1 && m1==m2 && d1>=d2))){
            if(isLeapYear(y1)){
                if(d1<daysL[m1-1]){
                    d1++;
                } else {
                    d1 = 1;
                    if(m1<12){
                        m1++;
                    } else {
                        m1 =1;
                        y1++;
                    }
                }
                count++;
            } else {
                if(d1<days[m1-1]){
                    d1++;
                } else {
                    d1 = 1;
                    if(m1<12){
                        m1++;
                    } else {
                        m1 =1;
                        y1++;
                    }
                }
                count++;
            }
        }

        System.out.println(count);

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble(){
            return Double.parseDouble(next());
        }
    }

}

import java.math.*;
import java.io.*;
import java.util.*;
import java.util.regex.*;
import java.util.*;

public class Main{

	public static boolean anoB(int year)
	{
	     return ((year%4==0&&year%100!=0)||(year%400==0));
	}
public static void main(String[] args) throws IOException {
	BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
	StringBuilder output = new StringBuilder();
	String line1 = input.readLine(), line2 = input.readLine();
	int ano1, ano2, mes1, mes2, dia1, dia2, anoD, mesD, diaD;
	ano1 = Integer.parseInt(line1.split(":")[0]);
	mes1 = Integer.parseInt(line1.split(":")[1]);
	dia1 = Integer.parseInt(line1.split(":")[2]);
	ano2 = Integer.parseInt(line2.split(":")[0]);
	mes2 = Integer.parseInt(line2.split(":")[1]);
	dia2 = Integer.parseInt(line2.split(":")[2]);
	int[] diasMesesN = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int[] diasMesesB = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	if ( ano1*10000+mes1*1000+dia1 < ano2*10000+mes2*1000+dia2)
	{
		anoD = ano1;
		mesD = mes1;
		diaD = dia1;
		ano1 = ano2;
		mes1 = mes2;
		dia1 = dia2;
		ano2 = anoD;
		mes2 = mesD;
		dia2 = diaD;
	}
	int count = 0;
	for( int i = 1900; i <= 2038; i++ )
	{
		for( int j = 1; j <= 12; j++ )
		{
			if ( anoB(i))
			{
				for( int k = 1; k <= diasMesesB[j-1] ; k++ )
				{

					if ( ano1 >= i )
					{
						if ( ano1 == i )
						{
							if ( mes1 >= j)
							{
								if ( mes1 == j)
								{
									if ( dia1 >= k)
									{
										count++;
									}
								}
								else count++;
							}
						}
						else count++;
					}
					if ( i <= ano2)
					{
						if ( i == ano2 )
						{
							if ( j <= mes2)
							{
								if ( j== mes2)
								{
									if ( k <= dia2) count--;
								}
								else count--;
							}
						}
						else count--;
					}
				}
			}
			else
			{
				for( int k = 1; k <= diasMesesN[j-1] ; k++ )
				{
					if ( ano1 >= i )
					{
						if ( ano1 == i )
						{
							if ( mes1 >= j)
							{
								if ( mes1 == j)
								{
									if ( dia1 >= k)
									{
										count++;
									}
								}
								else count++;
							}
						}
						else count++;
					}
					if ( i <= ano2)
					{
						if ( i == ano2 )
						{
							if ( j <= mes2)
							{
								if ( j== mes2)
								{
									if ( k <= dia2) count--;
								}
								else count--;
							}
						}
						else count--;
					}
				}
			}
		}
	}
	System.out.println((int)Math.abs(count));

}
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.StringTokenizer;
import java.util.TimeZone;

public class CalendarProb {
    public static void main(String[] args) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");

        String s1 = next();
        String s2 = next();

        long d1 = format.parse(s1).getTime();
        long d2 = format.parse(s2).getTime();

        long res = d1 - d2;
        res = Math.abs(res);
        res = Math.round(1.0 * res / (1000.0 * 60 * 60 * 24));
        writer.println(res);

        writer.close();
    }

    static PrintWriter writer = new PrintWriter(System.out);

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tokenizer = new StringTokenizer("");

    static String next() {
        while (!tokenizer.hasMoreTokens())
            try {
                tokenizer = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        return tokenizer.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

    static double nextDouble() {
        return Double.parseDouble(next());
    }
}

//package n183;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.SimpleTimeZone;
import java.util.TimeZone;

public class Cal {

	public static void main(String[] args) throws ParseException {
		// TODO Auto-generated method stub

        Scanner s = new Scanner(System.in);

        SimpleTimeZone st = new SimpleTimeZone(0,"");
        TimeZone.setDefault(st);
        DateFormat formatter = new SimpleDateFormat("yy:MM:dd");
        Date start = formatter.parse(s.next());
        Date end = formatter.parse(s.next());

        System.out.println(Math.abs((end.getTime() - start.getTime())/86400000));

//		Scanner s = new Scanner(System.in);
//		String st = s.next();
//		String en = s.next();
//
//		String ss[] = st.split(":");
//		String ee[] = en.split(":");

//		int ans = 0,year1 = Integer.valueOf(ss[0]),
//				year2 = Integer.valueOf(ee[0]),
//				month1, month2,day1,day2,
//				days[] = new int[]{31,28,31,30,31,30,31,31,30,31,30,31};
//
//		if (year2 > year1){
//			int temp = year1;
//			year1 = year2;
//			year2 = temp;
//
//			month1 = Integer.valueOf(ee[1]);
//			day1 = Integer.valueOf(ee[2]);
//			month2 = Integer.valueOf(ss[1]);
//			day2 = Integer.valueOf(ss[2]);
//
//		}else if (year1 > year2){
//			month1 = Integer.valueOf(ss[1]);
//			day1 = Integer.valueOf(ss[2]);
//			month2 = Integer.valueOf(ee[1]);
//			day2 = Integer.valueOf(ee[2]);
//		}else if )

//		if (Math.abs(year1 - year2) >= 2){
//			for (int i = Math.min(year2, year1); i<= Math.max(year2, year1); i++){
//				if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)){
//					ans+=366;
//				}else
//					ans+=365;
//			}
//		}
//
//		if (month1 )
//
//		Calendar c1 = Calendar.getInstance();
//		Calendar c2 = Calendar.getInstance();
//		c1.set(Calendar.YEAR, Integer.valueOf(ss[0]));
//		c1.set(Calendar.MONTH, Integer.valueOf(ss[1]));
//		c1.set(Calendar.DAY_OF_MONTH, Integer.valueOf(ss[2]));
//
//		c2.set(Calendar.YEAR, Integer.valueOf(ee[0]));
//		c2.set(Calendar.MONTH, Integer.valueOf(ee[1]));
//		c2.set(Calendar.DAY_OF_MONTH, Integer.valueOf(ee[2]));
//
//		System.out.println((c2.getTime().getTime() - c1.getTime().getTime())/86400000);
//
//		s.close();
	}

}

import java.io.PrintWriter;
import java.util.*;

public class Program {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        new Program().solve(in, out);

        out.flush();
    }

    int[] months = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

    class Date {
        int year;
        int month;
        int day;

        int compareTo(Date other) {
            if (other.year != this.year) {
                return this.year - other.year;
            }
            if (other.month != this.month) {
                return this.month - other.month;
            }
            return this.day - other.day;
        }
    }

    Date parseDate(String text) {
        String[] parts = text.split(":");
        Date date = new Date();
        date.year = Integer.parseInt(parts[0]);
        date.month = Integer.parseInt(parts[1]);
        date.day = Integer.parseInt(parts[2]);
        return date;
    }

    boolean isLeapYear(int year) {
        if (year % 400 == 0) {
            return true;
        }
        if (year % 100 == 0) {
            return false;
        }

        if (year % 4 == 0) {
            return true;
        }

        return false;
    }

    long daysInMonth(int year, int month) {
        long days = months[month];
        if (month == 2 && isLeapYear(year)) {
            days++;
        }
        return days;
    }

    long daysBetween(int startYear, int endYear) {
        long count = 365 * (endYear - startYear);
        for (int y = startYear; y < endYear; y++) {
            if (isLeapYear(y)) {
                count++;
            }
        }

        return count;
    }

    long daysFromYearStart(Date date) {
        long days = 0;
        for (int m = 1; m < date.month; m++) {
            days += daysInMonth(date.year, m);
        }
        days += date.day;
        return days;
    }

    void solve(Scanner in, PrintWriter out) {
        Date start = parseDate(in.nextLine());
        Date end = parseDate(in.nextLine());
        if (start.compareTo(end) > 0) {
            Date tmp = start;
            start = end;
            end = tmp;
        }

        long days = daysBetween(start.year, end.year) - daysFromYearStart(start) + daysFromYearStart(end);
        out.println(days);
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.StringTokenizer;
import java.util.TimeZone;

public class CalendarProb {
    public static void main(String[] args) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");

        format.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));

        String s1 = next();
        String s2 = next();

        long d1 = format.parse(s1).getTime();
        long d2 = format.parse(s2).getTime();

        long res = d1 - d2;
        res = Math.abs(res);

        writer.println(res / (1000 * 60 * 60 * 24));

        writer.close();
    }

    static PrintWriter writer = new PrintWriter(System.out);

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tokenizer = new StringTokenizer("");

    static String next() {
        while (!tokenizer.hasMoreTokens())
            try {
                tokenizer = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        return tokenizer.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

    static double nextDouble() {
        return Double.parseDouble(next());
    }
}

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;

public class CF183B {

    public static void main(String[] args) throws ParseException
    {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        DateFormat df = new SimpleDateFormat("yyyy:MM:dd");
        df.setTimeZone(TimeZone.getTimeZone("GMT+6:00"));
        Date d1 = df.parse(s1);
        Date d2 = df.parse(s2);
        System.out.println(Math.abs(d1.getTime()-d2.getTime())/(1000*60*60*24));
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            PrintWriter pw = new PrintWriter(System.out);

            String[] param = br.readLine().split(":");
            int y1 = Integer.parseInt(param[0]);
            int m1 = Integer.parseInt(param[1]);
            int d1 = Integer.parseInt(param[2]);
            param = br.readLine().split(":");
            int y2 = Integer.parseInt(param[0]);
            int m2 = Integer.parseInt(param[1]);
            int d2 = Integer.parseInt(param[2]);
            pw.println(Math.abs(getDays(y1,m1,d1)-getDays(y2,m2,d2)));
            pw.close();
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
    }

    private static int[] mdays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    private static int getDays(int year, int month, int day) {
        int[] mdayt = new int[12];
        for (int i = 1; i < 12; i++) mdayt[i] = mdayt[i-1] + mdays[i-1];
        year-=1900;
        day--;
        month--;
        int answer = year * 365;
        answer += year / 4;
        if (year > 0 && year % 4 == 0 && month < 2) answer--;
        answer += mdayt[month];
        answer+=day;
        return answer;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;

public class Solution {
    public static void main(String[] args)
            throws IOException, ParseException {
        BufferedReader br
                = new BufferedReader(new InputStreamReader(System.in));

        // Tool 1: SimpleDateFormat
        SimpleDateFormat sdf
                = new SimpleDateFormat("yyyy:MM:dd");
        // The line below is IMPORTANT! Must set timezone to UTC.
        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));

        // Tool 2: Date.getTime()
        Date date1 = sdf.parse(br.readLine());
        Date date2 = sdf.parse(br.readLine());
        long t = Math.abs(date1.getTime() - date2.getTime());

        // Tool 3: TimeUnit.MILLISECONDS.toDays()
        System.out.println(TimeUnit.MILLISECONDS.toDays(t));
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Calendar {
    public static void main(String[] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        String s1 = f.readLine();
        String s2 = f.readLine();
        Date d1;
        Date d2;
        if (s1.compareTo(s2) <= 0) {
            d1 = new Date(s1);
            d2 = new Date(s2);
        }
        else {
            d1 = new Date(s2);
            d2 = new Date(s1);
        }
        int count = 0;
        while (!d1.eq(d2)) {
            d1.inc();
            count++;
        }
        System.out.println(count);
    }

    public static class Date {
        int y;
        int m;
        int d;
        public Date(String s) {
            y = Integer.parseInt(s.substring(0,4));
            m = Integer.parseInt(s.substring(5,7));
            d = Integer.parseInt(s.substring(8,10));
        }
        public void inc() {
            int[] a = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
            if ((y%400 == 0) || (y%100 != 0 && y%4 == 0))
                a[2]++;
            d++;
            if (d > a[m]) {
                d = 1;
                m++;
                if (m == 13) {
                    m = 1;
                    y++;
                }
            }
        }
        public boolean eq(Date d2) {
            return y==d2.y && m==d2.m && d==d2.d;
        }

    }
}

import java.io.*;
import java.util.*;
import java.text.*;

public class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(new InputStreamReader(System.in));
        PrintWriter out=new PrintWriter(System.out);
        String d1 = in.nextLine();
        String d2 = in.nextLine();
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d2);
            date2 = format.parse(d1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        double difference = (double)date1.getTime()/ 24/60/60/1000 - (double)date2.getTime()/ 24/60/60/1000;
        out.println(Math.abs(Math.round(difference )));

        in.close();
        out.close();
    }

}

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;
public class Main {

	public static void main(String[] args) throws ParseException{
		Scanner sc = new Scanner(System.in);
		String s1 = sc.nextLine();
		String s2 = sc.nextLine();
		DateFormat date = new SimpleDateFormat("yyyy:MM:dd");
		date.setTimeZone(TimeZone.getTimeZone("UTC"));
		Date d1 = date.parse(s1);
		Date d2 = date.parse(s2);
		long x = Math.abs(d1.getTime()-d2.getTime())/(1000*60*60*24);
		System.out.println(x);
	}
}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Scanner;

public class A {

	public static void main(String[] args) throws ParseException {
		Scanner scanner = new Scanner(System.in);

		String s1 = scanner.next();
		String s2 = scanner.next();

		SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");

		double d1 = format.parse(s1).getTime() / (60.*60.*24.*1000.);
		double d2 = format.parse(s2).getTime() / (60.*60.*24.*1000.);

		System.out.print(Math.abs(Math.round(d2 - d1)));

		scanner.close();
	}

}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        String year1, year2 , t;
        Scanner scan = new Scanner(System.in);
        year1 = scan.next();
        year2 = scan.next();
        if(year1.compareTo(year2) > 0)
        {
            t = year1 ;
            year1 = year2 ;
            year2 = t ;
        }
        Calendar cal1 = new GregorianCalendar();
        Calendar cal2 = new GregorianCalendar();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");
        Date date;
        try {
            date = sdf.parse(year1);
            cal1.setTime(date);
            date = sdf.parse(year2);
            cal2.setTime(date);
            long a = daysBetween(cal1.getTime(), cal2.getTime());
            System.out.println(a);
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }

    public static long daysBetween(Date d1, Date d2) {
        return ((d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
    }
}

import java.io.*;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

public class Main {
    static void zap() throws IOException {
        String date = nextToken();
        int yy = Integer.parseInt(date.substring(0,0+4));
        int mm = Integer.parseInt(date.substring(5,5+2));
        int dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c1 = new GregorianCalendar();
        c1.set(yy,mm-1,dd);
        date = nextToken();
        yy = Integer.parseInt(date.substring(0,0+4));
        mm = Integer.parseInt(date.substring(5,5+2));
        dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c2 = new GregorianCalendar();
        c2.set(yy,mm-1,dd);
        long s = Math.abs(c2.getTimeInMillis() - c1.getTimeInMillis());
        out.println(s/(24 * 3600 * 1000));
    }

    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        InputStream input = System.in;
        //InputStream input = new FileInputStream("fileIn.in");
        OutputStream output = System.out;
        //OutputStream output = new FileOutputStream("fileOut.out");
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        zap();
        out.close();
    }

    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }
}

import java.io.*;
import java.util.*;
import java.math.*;

final public class Main implements Runnable {
	private static boolean local;

	public static void main(String[] args) {
		if (args.length > 0 && args[0].equals("local")) {
			local = true;
		}
		new Thread(null, new Main(), "mainthread", 1 << 27).start();
	}

	public void run() {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;

		try {
			if (local) {
				inputStream = new FileInputStream("X:/coding/workspace/java/main/io/input.txt");
				outputStream = new FileOutputStream("X:/coding/workspace/java/main/io/output.txt");
			} else {
				// inputStream = new FileInputStream("input.txt");
				// outputStream = new FileOutputStream("output.txt");
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

		Task solver = new Task();
		solver.in = new InputReader(inputStream);
		solver.out = new OutputWriter(outputStream);
		if (local) {
			solver.dout = new DebugWriter(solver.out);
		}
		solver.solve();
		solver.out.close();
	}
}

final class Task {
	public InputReader in;
	public OutputWriter out;
	public DebugWriter dout;

	void err() {
		System.err.println("err");
	}

	void err(String s) {
		System.err.println(s);
	}

	public void solve() {

		String[] s = in.readString().split(":");
		Date d1 = new Date(Integer.valueOf(s[0]), Integer.valueOf(s[1]), Integer.valueOf(s[2]));

		s = in.readString().split(":");
		Date d2 = new Date(Integer.valueOf(s[0]), Integer.valueOf(s[1]), Integer.valueOf(s[2]));

		long t1 = d1.getTime();
		long t2 = d2.getTime();
		if (t1 > t2) {
			long tmp = t1;
			t1 = t2;
			t2 = tmp;
		}

		long diff = (t2 - t1 + 1000 * 60 * 60 * 24 - 1) / (1000 * 60 * 60 * 24);
		out.printLine(diff);
	}
}

final class InputReader {
	private boolean finished = false;

	private InputStream stream;
	private byte[] buf = new byte[1 << 13];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	private int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int peek() {
		if (numChars == -1)
			return -1;
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				return -1;
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long readLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public static boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private String readLine0() {
		StringBuilder buf = new StringBuilder();
		int c = read();
		while (c != '\n' && c != -1) {
			if (c != '\r')
				buf.appendCodePoint(c);
			c = read();
		}
		return buf.toString();
	}

	public String readLine() {
		String s = readLine0();
		while (s.trim().length() == 0)
			s = readLine0();
		return s;
	}

	public String readLine(boolean ignoreEmptyLines) {
		if (ignoreEmptyLines)
			return readLine();
		else
			return readLine0();
	}

	public String readToEnd() {
		StringBuilder buf = new StringBuilder();
		int c = read();
		while (c != -1) {
			if (c != '\r')
				buf.appendCodePoint(c);
			c = read();
		}
		return buf.toString();
	}

	public BigInteger readBigInteger() {
		try {
			return new BigInteger(readString());
		} catch (NumberFormatException e) {
			throw new InputMismatchException();
		}
	}

	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}

	public double readDouble() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		double res = 0;
		while (!isSpaceChar(c) && c != '.') {
			if (c == 'e' || c == 'E')
				return res * Math.pow(10, readInt());
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		}
		if (c == '.') {
			c = read();
			double m = 1;
			while (!isSpaceChar(c)) {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, readInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				m /= 10;
				res += (c - '0') * m;
				c = read();
			}
		}
		return res * sgn;
	}

	public boolean isExhausted() {
		int value;
		while (isSpaceChar(value = peek()) && value != -1)
			read();
		return value == -1;
	}

	public void close() {
		try {
			stream.close();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}
}

final class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream), 1 << 13));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	public void print(Object... objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(Object... objects) {
		print(objects);
		writer.println();
	}

	public void printFormat(String format, Object... objects) {
		writer.printf(format, objects);
	}

	public void print(char[] objects) {
		writer.print(objects);
	}

	public void printLine(char[] objects) {
		writer.println(objects);
	}

	public void printLine(char[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(int[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(int[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(int[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(short[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(short[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(short[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(long[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(long[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(long[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(double[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(double[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(double[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(byte[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(byte[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(byte[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void print(boolean[] objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(boolean[] objects) {
		print(objects);
		writer.println();
	}

	public void printLine(boolean[][] objects) {
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
	}

	public void close() {
		writer.close();
	}

	public void flush() {
		writer.flush();
	}
}

final class DebugWriter {
	private final OutputWriter writer;

	public DebugWriter(OutputWriter writer) {
		this.writer = writer;
	}

	private void printDebugMessage() {
		writer.print("DEBUG:\t");
	}

	public void printLine(Object... objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printFormat(String format, Object... objects) {
		flush();
		printDebugMessage();
		writer.printFormat(format, objects);
		flush();
	}

	public void printLine(char[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(char[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(double[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(double[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(int[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(int[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(short[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(short[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(long[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(long[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(byte[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(byte[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void printLine(boolean[] objects) {
		flush();
		printDebugMessage();
		writer.printLine(objects);
		flush();
	}

	public void printLine(boolean[][] objects) {
		flush();
		for (int i = 0; i < objects.length; ++i)
			printLine(objects[i]);
		flush();
	}

	public void flush() {
		writer.flush();
	}
}

import java.util.GregorianCalendar;
import java.util.Scanner;

/**
 *
 * @author lstr
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String F1[] = sc.nextLine().split(":");
        String F2[] = sc.nextLine().split(":");
        if(Integer.parseInt(F1[0])>Integer.parseInt(F2[0])||(Integer.parseInt(F1[0])==Integer.parseInt(F2[0])&&Integer.parseInt(F1[1])>=Integer.parseInt(F2[1]))||( Integer.parseInt(F1[0])==Integer.parseInt(F2[1])&&Integer.parseInt(F1[1])==Integer.parseInt(F2[0])&& Integer.parseInt(F1[2])>Integer.parseInt(F2[2]))){
            String y=(F1[0]),m=(F1[1]),d=(F1[2]);
            F1[0]=F2[0];F1[1]=F2[1];F1[2]=F2[2];
            F2[0]=y;F2[1]=m;F2[2]=d;
        }

        GregorianCalendar gc=new GregorianCalendar(Integer.parseInt(F1[0]), Integer.parseInt(F1[1]), Integer.parseInt(F1[2]));
        GregorianCalendar gc2=new GregorianCalendar(Integer.parseInt(F2[0]), Integer.parseInt(F2[1]), Integer.parseInt(F2[2]));
        int days[]={31,28,31,30,31,30,31,31,30,31,30,31};
        int totDays=0;
        for (int i = Integer.parseInt(F1[0])+1; i < Integer.parseInt(F2[0]); i++)
            totDays+=(new GregorianCalendar().isLeapYear(i))?366:365;
        int mes=Integer.parseInt(F1[1]);
        int dias=days[mes-1]-Integer.parseInt(F1[2]);
        totDays+=dias;
        days[1]=(new GregorianCalendar().isLeapYear(Integer.parseInt(F1[1])))?29:28;
        for (int i = mes; i < 12; i++)
            totDays+=days[i];
        days[1]=(new GregorianCalendar().isLeapYear(Integer.parseInt(F2[1])))?29:28;
        mes=Integer.parseInt(F2[1]);
        dias=days[mes-1]-Integer.parseInt(F2[2]);
        totDays-=dias;
        for (int i = 0; i < mes; i++)
            totDays+=days[i];
        System.out.println(totDays-1);
    }
}

import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Solve implements Runnable{

final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException{
        if (ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException{
        while(!tok.hasMoreTokens()){
            try{
                tok = new StringTokenizer(in.readLine());
            }catch (Exception e){
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException{
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException{
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException{
        return Double.parseDouble(readString());
    }

    public static void main(String[] args){
        new Thread(null, new Solve(), "", 256 * (1L << 20)).start();
    }

    long timeBegin, timeEnd;

    void time(){
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    void debug(Object... objects){
        if (!ONLINE_JUDGE){
            for (Object o: objects){
                System.err.println(o.toString());
            }
        }
    }

    int sm(int x){
        if (x==1) return 0;else return 1;
    }

    int gcd(int a,int b){
        if (b==0) return a;
        else{
            return gcd(b,a%b);
        }
    }

    static int getd(int mes){
        int res=0;
        for (int i=1;i<mes;i++){
            if (i==1){
                res+=31;
            }
            if (i==2){
                res+=29;
            }
            if (i==3){
                res+=31;
            }
            if (i==4){
                res+=30;
            }
            if (i==5){
                res+=31;
            }
            if (i==6){
                res+=30;
            }
            if (i==7){
                res+=31;
            }
            if (i==8){
                res+=31;
            }
            if (i==9){
                res+=30;
            }
            if (i==10){
                res+=31;
            }
            if (i==11){
                res+=30;
            }
            if (i==12){
                res+=31;
            }
        }
        return res;
    }

   void sol() throws IOException {
       int n=readInt();
       int ans=0;
       if (n<5){
           ans=0;
       }else{
       int x=n-5;
       if (x>=0)
        ans=x/2+1;
       }

       out.println(ans);
   }

    void solve() throws IOException{
        char a[]=readString().toCharArray();
        char b[]=readString().toCharArray();
        int y1=Integer.parseInt(""+a[0]+a[1]+a[2]+a[3]);
        int y2=Integer.parseInt(""+b[0]+b[1]+b[2]+b[3]);
        int m1=Integer.parseInt(""+a[5]+a[6]);
        int d1=Integer.parseInt(""+a[8]+a[9]);
        int m2=Integer.parseInt(""+b[5]+b[6]);
        int d2=Integer.parseInt(""+b[8]+b[9]);
        int dd1=y1*366+getd(m1)+d1;
        int dd2=y2*366+getd(m2)+d2;

        if (dd2<dd1){
            int temp=y1;
            y1=y2;
            y2=temp;
            temp=m1;
            m1=m2;
            m2=temp;
            temp=d1;
            d1=d2;
            d2=temp;
        }
        int resob=Math.abs(dd1-dd2);
        int beg=y1;
        if (m1>2) beg++;
        int end=y2;
        if (m2<2) end--;
        for (int i=beg;i<=end;i++){
            if (i==1900) continue;
            if (i%4==0) resob--;
        }

        out.println(resob-1);

    }

    public void run(){
        try{
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        }catch (Exception e){
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

}

import java.util.*;
import java.io.*;

public class Main implements Runnable {

	public void solve() throws IOException {
                String one = nextToken();
                String two = nextToken();
                if(one.compareTo(two) == 0) {
                        System.out.println(0);
                        return;
                }
                if(one.compareTo(two) > 0){
                        String t = one;
                        one = two;
                        two = t;
                }
		String[] s1 = one.split(":");
                String[] s2 = two.split(":");

                int ans = 0;
                int y = Integer.parseInt(s1[0]);
                int m = Integer.parseInt(s1[1]);
                int d = Integer.parseInt(s1[2]);
                int yy = Integer.parseInt(s2[0]);
                int mm = Integer.parseInt(s2[1]);
                int dd = Integer.parseInt(s2[2]);

                ans -= (d);
                for(int i = m; i <= 12; i++) ans += getDaysInMonth(i, y);
                for(int i = 1; i<= mm; i++) ans += getDaysInMonth(i, yy);
                ans -= (getDaysInMonth(mm, yy) - dd);

                for(int i = y + 1; i < yy; i++) ans += getDaysInYear(i);

                System.out.println(ans);
	}

        private int getDaysInMonth(int month, int year){
                int[] days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

                if(month == 2)
                        if(leap(year))
                                return days[month] + 1;

                return days[month];
        }

        private boolean leap(int year){
                if(year % 400 == 0) return true;
                if(year % 100 == 0) return false;
                if(year % 4 == 0) return true;
                return false;
        }

	private int getDaysInYear(int year){
                if(leap(year)) return 366;
                return 365;
        }

	//-----------------------------------------------------------
	public static void main(String[] args) {
		new Main().run();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tok = null;
			solve();
			in.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	BufferedReader in;
	StringTokenizer tok;
}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class B304 {

    public BufferedReader in;
    public StringTokenizer tok;

    public String nextString() throws Exception{
        while(!tok.hasMoreElements()){
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public int nextInt() throws Exception{
        return Integer.parseInt(nextString());
    }

    public void init() throws Exception{
        in = new BufferedReader(new InputStreamReader(System.in));
        tok = new StringTokenizer("");
        solve();
    }
    public int getAllV(int st, int en){
        int res = 0;
        for (int i = st; i <= en; i++) {
            if (i%4 == 0){
                if (i%100 == 0){
                    if (i%400 == 0) res++;
                } else res++;
            }
        }
        return res;
    }

    public int monthDays(int ms,int me, int ys,int ye){
        int days = 0;
        for (int k = ys; k < ye; k++) {
            if (k%4 == 0){
                if (k%100 == 0){
                    if (k%400 == 0) days++;
                } else days++;
            }

            for (int i = 1; i <= 12; i++) {
                if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
                 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                    else days += 28;
            }
        }
        for (int i = ms; i <= me; i++) {
            if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
             else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                else days += 28;
        }
        return days;
    }

    public void solve() throws Exception{
        String d1 = nextString();
        String d2 = nextString();
        String tmp;
        int pldays= 0;
        int year1,year2;
        int month1,month2;
        int day1,day2;

        year1 = Integer.valueOf(d1.substring(0,4));
        year2 = Integer.valueOf(d2.substring(0,4));
        if (year1 > year2) {
            tmp = d1;
            d1 = d2;
            d2 = tmp;
        }
        /*month1 = Integer.valueOf(start.substring(5,7));
        month2 = Integer.valueOf(finish.substring(5,7));
        day1 = Integer.valueOf(start.substring(8,10));
        day2 = Integer.valueOf(finish.substring(8,10));

        if (year1 > year2){
            year2 = Integer.valueOf(start.substring(0,4));
            year1 = Integer.valueOf(finish.substring(0,4));
            month2 = Integer.valueOf(start.substring(5,7));
            month1 = Integer.valueOf(finish.substring(5,7));
            day2 = Integer.valueOf(start.substring(8,10));
            day1 = Integer.valueOf(finish.substring(8,10));
        }

        //year1 = ((year2-year1)*12)-1;
    */

        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d1);
            date2 = format.parse(d2);
        } catch (Exception e) {

        }

        long difference = date2.getTime()-date1.getTime();
        double days = difference / (86400000.0);
        //if(days==1578)
        //  System.out.println(difference);
        System.out.println(Math.round(days));

        /*
        day1 = Math.abs(day2-day1);
        System.out.println((monthDays(month1,month2,year1,year2)));
        */
    }

    public static void main(String[] args) throws Exception {
        new B304().init();
    }

}

import java.util.*;

public class tuman {

    static int r(date a11, date b11){

        date a1 =  new date(a11.day, a11.mounth, a11.year);
        date b1 =  new date(b11.day, b11.mounth, b11.year);
        int ans=0;
        while (ans<10000000){
            a1.next();
            ans++;

        //  System.out.println(ans+" ");

                        if (a1.day == b1.day)
                 if (a1.mounth == b1.mounth)
                     if (a1.year == b1.year) break;
        }
        return ans;
    }

    static public void solve(Scanner in){

        String[] a = in.nextLine().split(":");
        String[] b = in.nextLine().split(":");

        date a1 = new date(Integer.parseInt(a[2]), Integer.parseInt(a[1]), Integer.parseInt(a[0]));
        date b1 = new date(Integer.parseInt(b[2]), Integer.parseInt(b[1]), Integer.parseInt(b[0]));

     System.out.println(Math.min(r(a1, b1), r(b1, a1)));
    }

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
            solve(in);

    }

}

class date{
    int day;
    int mounth;
    int year;

    int[] m = {0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    date(){
        this(0, 0, 0);
    }

    date(int d, int m, int y){
        day = d;
        mounth = m;
        year = y;
    }

    boolean v(){
        if (year%4 == 0 && year%100 !=0) return true;
        if (year%400 ==0) return true;
        return false;
    }

    void next(){
        if (v()) m[1] = 29; else m[1] = 28;
        day++;
        if (day > m[mounth]){
            day = 1;
            mounth++;
             if (mounth>12)
             {
                 mounth = 1;
                 year++;
             }
        }
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)   throws Exception {
	//	86164,091

		BufferedReader br =  new BufferedReader(new InputStreamReader(System.in));
		// TODO Auto-generated method stub
		String line[];
		int aa , mm , dd ;
		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]);
		dd = Integer.parseInt(line[2]);

		GregorianCalendar a =  new GregorianCalendar(aa , mm , dd);

		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]);
		dd = Integer.parseInt(line[2]);
		GregorianCalendar b =  new GregorianCalendar(aa , mm, dd);

		 long  res  =  Math.abs( a.getTimeInMillis() - b.getTimeInMillis());
		 b =  new GregorianCalendar();

		double z =  ((double)res /(1000*60*60*24));

		if(z - (long)z == 0) z = (long)(z -1);
		else z =  z + 1;
		 System.out.println((long)z);

	}

}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			else if (y < d1.y)
				return -1;

			if (m > d1.m)
				return 1;
			else if (m < d1.m)
				return -1;

			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		if (d1.m == 2 && d2.d < 29)
			answer--;

		answer += d2.d;
		if (d2.m == 2 && d2.d == 29)
			answer--;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(answer);
	}
}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			else if (y < d1.y)
				return -1;

			if (m > d1.m)
				return 1;
			else if (m < d1.m)
				return -1;

			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		if (d1.m == 2 && d1.d <= 29 && d1.y % 4 ==0 && d1.y > 1900)
			answer--;

		answer += d2.d;
		if (d2.m == 2 && d2.d == 29)
			answer--;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(answer);
	}
}

import java.io.*;
import java.util.*;

public class Problems1 {

    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        //int n = Integer.parseInt(r.readLine());
        StringTokenizer in= new StringTokenizer(r.readLine(),":");
        int m[]={0,31,59,90,120,151,181,212,243,283,304,334,365};
        int y1,m1,d1,y2,m2,d2,f1,f2;

        y1=Integer.parseInt(in.nextToken());
        m1=Integer.parseInt(in.nextToken());
        d1=Integer.parseInt(in.nextToken());

        in= new StringTokenizer(r.readLine(),":");

        y2=Integer.parseInt(in.nextToken());
        m2=Integer.parseInt(in.nextToken());
        d2=Integer.parseInt(in.nextToken());

        f1=y1*365+m[m1-1]+d1;
        f2=y2*365+m[m2-1]+d2;

        for(int i=1;i<y1;i++){
            if(i%4==0){
                if(i%100!=0 || (i%100==0 && i%400==0))f1++;
            }
        }

        for(int i=1;i<y2;i++){
            if(i%4==0){
                if(i%100!=0 || (i%100==0 && i%400==0))f2++;
            }

        }
        if(m1>2){
            if(y1%4==0){
                if(y1%100!=0 || (y1%100==0 && y1%400==0))f1++;
            }
        }
        if(m2>2){
            if(y2%4==0){
                if(y2%100!=0 || (y2%100==0 && y2%400==0))f2++;
            }
        }

        System.out.println(Math.abs(f1-f2));

    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)   throws Exception {

		BufferedReader br =  new BufferedReader(new InputStreamReader(System.in));
		// TODO Auto-generated method stub
		String line[];
		int aa , mm , dd ;
		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]) - 1;
		dd = Integer.parseInt(line[2]);

		GregorianCalendar a =  new GregorianCalendar(aa , mm , dd);

		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]) - 1;
		dd = Integer.parseInt(line[2]);
		GregorianCalendar b =  new GregorianCalendar(aa , mm, dd);

		 long  res  =   Math.abs(a.getTimeInMillis() - b.getTimeInMillis());
		 b =  new GregorianCalendar();

		long z =  (res /(86400000));

		 System.out.println(z);

	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.StringTokenizer;
import java.util.TimeZone;

public class CalendarProb {
    public static void main(String[] args) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");

        String s1 = next();
        String s2 = next();

        long d1 = format.parse(s1).getTime();
        long d2 = format.parse(s2).getTime();

        long res = d1 - d2;
        res = Math.abs(res);

        writer.println(Math.round(res) / (1000.0 * 60 * 60 * 24));

        writer.close();
    }

    static PrintWriter writer = new PrintWriter(System.out);

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tokenizer = new StringTokenizer("");

    static String next() {
        while (!tokenizer.hasMoreTokens())
            try {
                tokenizer = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        return tokenizer.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

    static double nextDouble() {
        return Double.parseDouble(next());
    }
}

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		doIt2();
	}
	static void doIt2(){
		GregorianCalendar gc1, gc2;
		int fyear, fmonth, fday, tyear, tmonth, tday;
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] ss = s.split(":");
		fyear = Integer.parseInt(ss[0]);
		fmonth = Integer.parseInt(ss[1]);
		fday = Integer.parseInt(ss[2]);
		s = sc.next();
		ss = s.split(":");
		tyear = Integer.parseInt(ss[0]);
		tmonth = Integer.parseInt(ss[1]);
		tday = Integer.parseInt(ss[2]);
		gc1 = new GregorianCalendar(fyear, fmonth-1, fday);
		gc2 = new GregorianCalendar(tyear, tmonth-1, tday);
		long result = Math.abs(gc1.getTimeInMillis() - gc2.getTimeInMillis());
		long div = 24 * 60 * 60 * 1000;
		//if(result % div == 0) System.out.println("aaa");
		result /= div;
		System.out.println(result);
	}
}

import java.io.*;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Evgeny Savinov
 */
public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        InputStream inputStream = System.in;//new FileInputStream("input.txt");
        OutputStream outputStream = System.out;//new FileOutputStream("output.txt");//
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskE {

    public void solve(int testNumber, InputReader in, PrintWriter out)
    {
        SimpleDateFormat z = new SimpleDateFormat("yyyy:MM:dd");
        Date a = null, b = null;
        try {
            a = z.parse(in.next());
        } catch (ParseException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        try {
            b = z.parse(in.next());
        } catch (ParseException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

        long diff = -a.getTime() + b.getTime();
        if (diff > 0)
        {
            out.println(diff / 1000 / 3600 / 24);
        }
        else
        {
            out.println(-diff / 1000 / 3600 / 24 + 1);
        }

    }
}

class InputReader
{
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
}

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String [] args ) {
		try{
			String str;
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			BufferedOutputStream bos = new BufferedOutputStream(System.out);
			String eol = System.getProperty("line.separator");
			byte [] eolb = eol.getBytes();
			byte[] spaceb= " ".getBytes();

			str = br.readLine();
			StringTokenizer st1 = new StringTokenizer(str,":");
			int y1 = Integer.parseInt(st1.nextToken());
			int m1 = Integer.parseInt(st1.nextToken());
			int d1 = Integer.parseInt(st1.nextToken());
			str = br.readLine();
			StringTokenizer st2 = new StringTokenizer(str,":");
			int y2 = Integer.parseInt(st2.nextToken());
			int m2 = Integer.parseInt(st2.nextToken());
			int d2 = Integer.parseInt(st2.nextToken());
			int ans = numDay(d2,m2,y2) - numDay(d1,m1,y1);
			if(ans<0) {
				ans *= -1;
			}
			bos.write(new Integer(ans).toString().getBytes());
			bos.write(eolb);
			bos.flush();
		}  catch(IOException ioe) {
			ioe.printStackTrace();
		}
	}

	public static int days(int m) {
		int ans = 0;
		switch(m) {
		case 1 :
			ans += 31;
			break;
		case 2 :
			ans += 28;
			break;
		case 3 :
			ans += 31;
			break;
		case 4 :
			ans += 30;
			break;
		case 5 :
			ans += 31;
			break;
		case 6 :
			ans += 30;
			break;
		case 7 :
			ans += 31;
			break;
		case 8 :
			ans += 31;
			break;
		case 9 :
			ans += 30;
			break;
		case 10 :
			ans += 31;
			break;
		case 11 :
			ans += 30;
			break;
		default :
			ans += 31;
			break;
		};
		return ans;
	}

	public static int numDay(int d , int m , int y) {
		int ans = d;
		for(int i = 1900 ; i < y ; i++) {
			if(isLeap(i)) {
				ans += 366;
			} else {
				ans += 365;
			}
		}
		for(int i = 1 ; i < m ; i++) {
			ans += days(i);
		}

		if(isLeap(y)) {
			ans++;
		}
		return ans;
	}

	public static boolean isLeap(int y) {
		if((y%400)==0) {
			return true;
		}
		if((y%100)==0) {
			return false;
		}
		if((y%4)==0) {
			return true;
		}
		return false;
	}
}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;

public class a{
 public static long getQuot(String time1, String time2){
  long quot = 0;
  SimpleDateFormat ft = new SimpleDateFormat("yyyy:MM:dd");
  ft.setTimeZone(TimeZone.getTimeZone("UTC"));
  try {
   Date date1 = ft.parse( time1 );
   Date date2 = ft.parse( time2 );
   quot = date1.getTime() - date2.getTime();
   quot = quot / (1000 * 60 * 60 * 24);
  } catch (ParseException e) {
   e.printStackTrace();
  }
  if(quot==0)
      return 1;
  return quot;
 }
 public static void main(String[] args) throws Exception {
    Scanner r = new Scanner(System.in);
  String date1 = r.nextLine();
  String date2 = r.nextLine();
  long day = getQuot(date2,date1);
  System.out.println(Math.abs(day));
 }
}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			if (m > d1.m)
				return 1;
			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		answer += d2.d;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(Math.abs(answer));
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

/**
 * Recordar la clase simpleFormar
 * */
public class B_Div2_183 {
    public static void main(String[]arg) throws IOException
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String line = in.readLine();
        int yy = Integer.parseInt(line.substring(0, 4));
        int mm = Integer.parseInt(line.substring(5, 7));
        int dd = Integer.parseInt(line.substring(8, 10));
        Calendar cIni = new GregorianCalendar();
        cIni.set(yy, mm-1, dd);
        String lines = in.readLine();
        int y1 = Integer.parseInt(lines.substring(0, 4));
        int m1 = Integer.parseInt(lines.substring(5, 7));
        int d1 = Integer.parseInt(lines.substring(8, 10));
        Calendar cFin = new GregorianCalendar();
        cFin.set(y1, m1-1, d1);
        if(cFin.before(cIni))
        {
            Calendar temp = cFin;
            cFin = cIni;
            cIni = temp;
        }
        int days = 0;
        for(;cIni.before(cFin);cIni.add(Calendar.DAY_OF_MONTH,1))
            days++;
        System.out.println(days);//not
    }
}

//package codeforces;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;

public class A implements Closeable {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    A() throws IOException {
//        reader = new BufferedReader(new FileReader("input.txt"));
//        writer = new PrintWriter(new FileWriter("output.txt"));
    }

    StringTokenizer stringTokenizer;

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            stringTokenizer = new StringTokenizer(reader.readLine());
        }
        return stringTokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    private int MOD = 1000 * 1000 * 1000 + 7;

    int sum(int a, int b) {
        a += b;
        return a >= MOD ? a - MOD : a;
    }

    int product(int a, int b) {
        return (int) (1l * a * b % MOD);
    }

    int pow(int x, int k) {
        int result = 1;
        while (k > 0) {
            if (k % 2 == 1) {
                result = product(result, x);
            }
            x = product(x, x);
            k /= 2;
        }
        return result;
    }

    int inv(int x) {
        return pow(x, MOD - 2);
    }

    void solve() throws IOException {
        DateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        try {
            long d = format.parse(next()).getTime() - format.parse(next()).getTime();
            d /= 1000 * 60 * 60 * 24;
            if(d < 0) {
                d = -d;
            } else {
                d++;
            }
            writer.println(d);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) throws IOException {
        try (A a = new A()) {
            a.solve();
        }
    }

    @Override
    public void close() throws IOException {
        reader.close();
        writer.close();
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class B_304 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(
				System.in)));
		String []from = sc.next().split(":");
		String []to = sc.next().split(":");

		int daysCount = 0;

		int fromYear = Integer.parseInt(from[0]);
		int fromMonth = Integer.parseInt(from[1]);
		int fromDat = Integer.parseInt(from[2]);
		int toYear = Integer.parseInt(to[0]);
		int toMonth = Integer.parseInt(to[1]);
		int toDay = Integer.parseInt(to[2]);

		if(fromYear > toYear || ((fromYear == toYear &&
				fromMonth >toMonth) || fromMonth == toMonth && fromDat > toDay)
				) {
			int tmp = fromYear;
			fromYear = toYear;
			toYear = tmp;
			tmp = fromMonth;
			fromMonth = toMonth;
			toMonth = tmp;
			tmp = fromDat;
			fromDat = toDay;
			toDay = tmp;
		}

		while(fromYear < toYear) {
			fromYear++;
			if(fromYear%400 ==0) {
				daysCount+=366;
			} else if(fromYear%100 ==0 || fromYear%4 != 0) {
				daysCount+=365;
			} else if(fromYear%4==0) {
				daysCount+=366;
			}

		}
		List<Integer> thirtyOneMonths = Arrays.asList(1,3,5,7,8,10,12);
		while(fromMonth <toMonth) {
			fromMonth++;
			if(thirtyOneMonths.contains(fromMonth))
				daysCount+=31;
			else if(fromMonth == 2 && fromYear%400==0 ) {
				daysCount +=29;
			} else if(fromMonth == 2 && (fromYear%100==0 || fromYear%4!=0)) {
				daysCount +=28;
			} else if(fromMonth == 2 ) {
				daysCount +=29;
			} else {
				daysCount+=30;
			}

		}

		while(toMonth <fromMonth) {
			fromMonth--;
			if(thirtyOneMonths.contains(fromMonth))
				daysCount-=31;
			else if(fromMonth == 2 && fromYear%400==0 ) {
				daysCount -=29;
			} else if(fromMonth == 2 && (fromYear%100==0 || fromYear%4!=0)) {
				daysCount -=28;
			} else if(fromMonth == 2 ) {
				daysCount -=29;
			} else {
				daysCount-=30;
			}

		}

			if(fromDat <toDay)
				daysCount += toDay-fromDat;
			else if(toDay < fromDat)
				daysCount -= fromDat -toDay;

		System.out.println(daysCount);
	}

	static boolean isBoundry(int year, int month, int day, List<Integer> thirtyOneMonths) {
		if(month==2 && (year%400==0 || (year%100!=0 && year%4==0) )) {
			return day == 29;
		}
		if(month == 2)
			return day==28;
		if(thirtyOneMonths.contains(month))
			return day==31;
		return day==30;
	}

}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class D {

    public static int daysBetween(Date d1, Date d2){
        int milli = 1000 * 60 * 60 * 24;
         return (int)( (d2.getTime() - d1.getTime()) / milli);
     }

    public static void main(String[] args)throws Exception {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        Calendar onee = new GregorianCalendar();
        Calendar twoo = new GregorianCalendar();

        SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy");

        String[] one,two;
        one = read.readLine().split(":");
        two = read.readLine().split(":");

        Date date = sdf.parse(one[2] + one[1] + one[0]);
        onee.setTime(date);
        date = sdf.parse(two[2] + two[1] + two[0]);
        twoo.setTime(date);
        System.out.println(Math.abs(daysBetween(onee.getTime(),twoo.getTime())));
    }
}

import com.sun.org.apache.xerces.internal.util.IntStack;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Calendar304 {

    public static void main(String[] args) throws Exception {
        HashMap<Integer, Integer> months = new HashMap<Integer, Integer>();
        months.put(0, 0);
        months.put(1, 31);
        months.put(2, 59);
        months.put(3, 90);
        months.put(4, 120);
        months.put(5, 151);
        months.put(6, 181);
        months.put(7, 212);
        months.put(8, 243);
        months.put(9, 273);
        months.put(10, 304);
        months.put(11, 334);
        months.put(12, 365);

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] firstDate = in.readLine().split(":");
        String[] secondDate = in.readLine().split(":");

        int totaldays1, totaldays2, yeardiff1, yeardiff2, yeardiff3;
        int year1, year2, month1, month2, day1, day2;
        year1 = Integer.parseInt(firstDate[0]);
        year2 = Integer.parseInt(secondDate[0]);
        month1 = Integer.parseInt(firstDate[1]);
        month2 = Integer.parseInt(secondDate[1]);
        day1 = Integer.parseInt(firstDate[2]);
        day2 = Integer.parseInt(secondDate[2]);

        totaldays1 = year1 * 365 + months.get(month1 - 1) + day1;
        totaldays2 = year2 * 365 + months.get(month2 - 1) + day2;
        //System.out.println(totaldays2 - totaldays1 + "sdasd");

        if (Math.abs(year2 - year1) >= 4) {
            yeardiff1 = year2 / 4 - year1 / 4;
            yeardiff2 = year2 / 100 - year1 / 100;
            yeardiff3 = year2 / 400 - year1 / 400;
            yeardiff1 = yeardiff1 - yeardiff2 + yeardiff3;
        } else {
            yeardiff1 = 0;
        }
        // 1 - 1 + 1;
        System.out.println("yeardiff" + yeardiff1);

        int sum = Math.abs(totaldays1 - totaldays2) + Math.abs(yeardiff1);

        //System.out.println(sum + "original\n");
//        if (month1 > 2 || (month1 == 2 && day1 >= 28)) {
//            sum++;
//        }
//        if (month2 < 2 || (month2 == 2 && day2 <= 28)) {
//            //sum--;
//        }
//        if (month1 < 2 || (month1 == 2 && month1 >= 28)) {
//            //sum++;
//        }
        System.out.println(sum);
        in.close();

    }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;

public class cf304b {

    static BufferedReader br;
    static Scanner sc;
    static PrintWriter out;

    public static void initA() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            //br = new BufferedReader(new FileReader("input.txt"));
            sc = new Scanner(System.in);
            //out = new PrintWriter("output.txt");
            out = new PrintWriter(System.out);
        } catch (Exception e) {
        }
    }

    static boolean next_permutation(Integer[] p) {
        for (int a = p.length - 2; a >= 0; --a) {
            if (p[a] < p[a + 1]) {
                for (int b = p.length - 1;; --b) {
                    if (p[b] > p[a]) {
                        int t = p[a];
                        p[a] = p[b];
                        p[b] = t;
                        for (++a, b = p.length - 1; a < b; ++a, --b) {
                            t = p[a];
                            p[a] = p[b];
                            p[b] = t;
                        }
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public static void initB() {
        try {

            br = new BufferedReader(new FileReader("input.txt"));
            sc = new Scanner(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");

        } catch (Exception e) {
        }
    }

    public static String getString() {
        try {
            return br.readLine();
        } catch (Exception e) {
        }
        return "";
    }

    public static Integer getInt() {
        try {
            return Integer.parseInt(br.readLine());
        } catch (Exception e) {
        }
        return 0;
    }

    public static Integer[] getIntArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Integer temp2[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Integer.parseInt(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Long[] getLongArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Long temp2[] = new Long[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Long.parseLong(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static String[] getStringArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            String temp2[] = new String[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = (temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static int getMax(Integer[] ar) {
        int t = ar[0];
        for (int i = 0; i < ar.length; i++) {
            if (ar[i] > t) {
                t = ar[i];
            }
        }
        return t;
    }

    public static void print(Object a) {
        out.println(a);
    }

    public static void print(String s, Object... a) {
        out.printf(s, a);
    }

    public static int nextInt() {
        return sc.nextInt();
    }

    public static double nextDouble() {
        return sc.nextDouble();
    }

    public static void main(String[] ar) throws Exception {
        initA();
        solve();
        out.flush();
    }

    static boolean kabisat(int tahun) {
      if(tahun == 2000){
          return true;
      }
      if(tahun == 1900){
          return false;
      }
      if(tahun % 4 == 0){
          return true;
      }
      return false;
    }

    static int getHari(int bulan, int tahun) {
        if(bulan > 7){
            if(bulan % 2 == 0){
                return 31;
            }else{
                return 30;
            }
        }

        if (bulan % 2 == 1) {
            return 31;
        } else {
            if (bulan == 2) {
                if (kabisat(tahun)) {
                    return 29;
                } else {
                    return 28;
                }
            } else {
                return 30;
            }
        }
    }

    static int getHari(int tahun) {
        if (kabisat(tahun)) {
            return 366;
        } else {
            return 365;
        }
    }

    public static void solve() throws Exception {
        String a = getString();
        String b = getString();

        int ta = Integer.valueOf(a.replace(":", ""));
        int tb = Integer.valueOf(b.replace(":", ""));

        if (ta > tb) {
            String temp = a;
            a = b;
            b = temp;
        }
        //print(a);
        //print(b);
        String p[] = a.split(":");

        String p2[] = b.split(":");

        int th = Integer.valueOf(p[0]), bulan = Integer.valueOf(p[1]), hari = Integer.valueOf(p[2]);
        int th2 = Integer.valueOf(p2[0]), bulan2 = Integer.valueOf(p2[1]), hari2 = Integer.valueOf(p2[2]);

        int ou = 0;
        int last = 0;

        while (th != th2 || bulan != bulan2 || hari != hari2) {
            if (th2 - th > 1) {
                ou += getHari(th);
                th++;
            } else {
                if (th == th2) {
                    //int k = 0;
                    while (bulan < bulan2) {
                        ou += getHari(bulan, th);
                        //k+=getHari(bulan,th);
                        //print("bulan ke %d tahun %d jml harinya: %d\n", bulan, th, getHari(bulan,th));
                        bulan++;
                    }
                                //print("%d:%d:%d %d\n", th, bulan, hari, ou);
                    if (hari < hari2) {
                        ou += hari2 - hari;
                        hari = hari2;
                    }
                    if (hari > hari2) {
                        ou -= hari - hari2;
                        hari = hari2;
                    }
                }
                if (th2 - th == 1) {
                    while (bulan <= 12) {
                        ou += getHari(bulan, th);
                        //print("bulanX ke %d tahun %d jml harinya: %d\n", bulan, th, getHari(bulan,th));
                        bulan++;
                    }
                    th++;
                    bulan = 1;
                }

            }
            //print("%d:%d:%d %d\n", th, bulan, hari, ou);
            //print("bertambah %d hari\n", ou -last);
            last= ou;

        }
        print(ou);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
    static int[] months = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] date1 = br.readLine().split(":");
        String[] date2 = br.readLine().split(":");

        int y1 = Integer.parseInt(date1[0]);
        int m1 = Integer.parseInt(date1[1]);
        int d1 = Integer.parseInt(date1[2]);

        int y2 = Integer.parseInt(date2[0]);
        int m2 = Integer.parseInt(date2[1]);
        int d2 = Integer.parseInt(date2[2]);

        if (y1 > y2 || (y1 == y2 && m1 > m2)
                || (y1 == y2 && m1 == m2 && d1 > d2)) {
            // swap
            int t = y1;
            y1 = y2;
            y2 = t;

            t = m1;
            m1 = m2;
            m2 = t;

            t = d1;
            d1 = d2;
            d2 = t;
        }

        int total = 0;
        if (y1 < y2) {
            int d = 0;
            if (isLeap(y1))
                d = 1;

            months[1] += d;
            total += months[m1 - 1] - d1;
            for (int i = m1; i < months.length; i++)
                total += months[i];
            months[1] -= d;
        }else{
            int d = 0;
            if (isLeap(y1))
                d = 1;

            months[1] += d;
            total += months[m1 - 1] - d1;

            months[1] -= d;

        }

        for (int i = y1 + 1; i < y2; i++)
            if (isLeap(i))
                total += 366;
            else
                total += 365;

        if (isLeap(y2))
            months[1]++;

        int start = y1 == y2 ? m1 : 0;
        for (int i = start; i < m2 - 1; i++)
            total += months[i];

        if (y1 == y2 && m1 == m2)
            total += d2 - d1;
        else
            total += d2;

        System.out.println(total);
    }

    private static boolean isLeap(int y2) {
        return (y2 % 400 == 0 || (y2 % 4 == 0 && y2 % 100 != 0));
    }
}

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String s1 = scan.next();
		String s2 = scan.next();

		int y1 = Integer.parseInt(s1.substring(0, 4));
		int y2 = Integer.parseInt(s2.substring(0, 4));
		int m1 = Integer.parseInt(s1.substring(5, 7));
		int m2 = Integer.parseInt(s2.substring(5, 7));
		int d1 = Integer.parseInt(s1.substring(8));
		int d2 = Integer.parseInt(s2.substring(8));

		if (y1 > y2) {
			int temp = y1;
			y1 = y2;
			y2 = temp;
			temp = m1;
			m1 = m2;
			m2 = temp;
			temp = d1;
			d1 = d2;
			d2 = temp;
		} else if (y1 == y2) {
			if (m1 == m2) {
				if (d1 > d2) {
					int temp = y1;
					y1 = y2;
					y2 = temp;
					temp = m1;
					m1 = m2;
					m2 = temp;
					temp = d1;
					d1 = d2;
					d2 = temp;
				}
				if (d1 == d2) {
					System.out.println(0);
					System.exit(0);
				}
			} else if (m1 > m2) {
				int temp = y1;
				y1 = y2;
				y2 = temp;
				temp = m1;
				m1 = m2;
				m2 = temp;
				temp = d1;
				d1 = d2;
				d2 = temp;
			}
		}

		int total = 0;
		for (int i = m1; i <= 12; i++) {
			if (i == 2)
				total += 28;
			else if (i <= 7) {
				if (i % 2 == 0)
					total += 30;
				else
					total += 31;
			} else {
				if (i % 2 != 0)
					total += 30;
				else
					total += 31;
			}
		}
		total -= (d1 - 1);
		if (isLeap(y1) && m1 <= 2) {
			total++;
		}
		for (int i = y1 + 1; i < y2; i++) {
			if (isLeap(i))
				total += 366;
			else
				total += 365;
		}
		for (int i = 1; i < m2; i++) {
			if (i == 2)
				total += 28;
			else if (i <= 7) {
				if (i % 2 == 0)
					total += 30;
				else
					total += 31;
			} else {
				if (i % 2 != 0)
					total += 30;
				else
					total += 31;
			}
		}
		total += d2 - 1;
		if (isLeap(y2) && m2 > 2)
			total++;

		System.out.println(total);

		scan.close();
	}

	public static boolean isLeap(int y) {
		if (y % 4 == 0) {
			if (y % 100 == 0) {
				if (y % 400 == 0)
					return true;
				return false;
			}
			return true;
		}
		return false;
	}
}

import java.util.Scanner;

public class Main {
    Scanner scan=new Scanner(System.in);
    public void doIt(){
        int [] month = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

        String s = scan.next();
        String e = scan.next();

        if(s.compareTo(e)> 0 ){
            String tmp = s;
            s = e;
            e = tmp;
        }

        String [] start = s.split(":");
        String [] end = e.split(":");

        int sum = 0;

        int sy = Integer.parseInt(start[0]);
        int sm = Integer.parseInt(start[1]);
        int sd = Integer.parseInt(start[2]);
        int ey = Integer.parseInt(end[0]);
        int em = Integer.parseInt(end[1]);
        int ed = Integer.parseInt(end[2]);

        sum = month[sm] - sd + 1;

        for(int i = sm+1; i<=12; i++){
            sum += month[i];
        }

        for(int i = sy+1; i<ey; i++){
            int set = 365;
            if(intercalary(i))set = 366;
            sum += set;
        }

        for(int i = 1; i<em; i++){
            sum += month[i];
        }

        if(intercalary(ey) && (ed > 3 ))sum += 1;
        if(intercalary(sy) && (sm < 3 ))sum += 1;

        sum += ed-1;
        System.out.println(sum);
    }

    public boolean intercalary(int y){
        if((y % 4 == 0) && ((y % 100 == 0 && y % 400 == 0) || (y % 100 != 0))){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        Main obj = new Main();
        obj.doIt();
    }

}

import java.io.*;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

public class Main {
    static void zap() throws IOException {
        String date = nextToken();
        int yy = Integer.parseInt(date.substring(0,0+4));
        int mm = Integer.parseInt(date.substring(5,5+2));
        int dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c1 = new GregorianCalendar();
        c1.set(yy,mm-1,dd);
        date = nextToken();
        yy = Integer.parseInt(date.substring(0,0+4));
        mm = Integer.parseInt(date.substring(5,5+2));
        dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c2 = new GregorianCalendar();
        c2.set(yy,mm-1,dd);
        long ms = Math.abs(c2.getTimeInMillis() - c1.getTimeInMillis());
        out.println((ms + 1)/(24 * 3600 * 1000));
    }

    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        InputStream input = System.in;
        //InputStream input = new FileInputStream("fileIn.in");
        OutputStream output = System.out;
        //OutputStream output = new FileOutputStream("fileOut.out");
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        zap();
        out.close();
    }

    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }
}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class Main
{
	public static void main(String[] args) throws ParseException
	{
		SimpleDateFormat format=new SimpleDateFormat("yyyy:MM:dd");
		Scanner cin=new Scanner(System.in);
		String str;
		str=cin.next();
	    Date start=format.parse(str);
	    str=cin.next();
	    Date end=format.parse(str);
		//System.out.println(start+" "+end+" "+start.getTime()+" "+end.getTime());
	    long len=(end.getTime()-start.getTime())/86400000;
	    System.out.println(len>0?len:-len);
	    cin.close();
	}
}

/*edgmcinpjgkpdmbfeootphghrspfokkknichqhprffejjggnaa*/

import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    static Scanner input = new Scanner(System.in);

    public static void main(String[] args) throws ParseException {
        String t1 = input.next();
        String t2 = input.next();
            DateFormat date  = new SimpleDateFormat("yyyy:MM:dd");
            date.setTimeZone(TimeZone.getDefault());
            System.out.println(Math.abs(date.parse(t1).getTime()-date.parse(t2).getTime())/(1000*60*60*24));
}

}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class A {

    public static void main(String[] args) {
        String year1, year2;
        Scanner scan = new Scanner(System.in);
        year1 = scan.next();
        year2 = scan.next();
        Calendar cal1 = new GregorianCalendar();
        Calendar cal2 = new GregorianCalendar();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");
        Date date;
        try {
            date = sdf.parse(year1);
            cal1.setTime(date);
            date = sdf.parse(year2);
            cal2.setTime(date);
            int a = daysBetween(cal1.getTime(), cal2.getTime());
            System.out.println(Math.abs(a));
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }

    public static int daysBetween(Date d1, Date d2) {
        return (int) ((d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class B {

    public static void main(String[] args) throws IOException, ParseException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String s1 = reader.readLine(), s2 = reader.readLine();

        DateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = format.parse(s1), date2 = format.parse(s2);
        System.out.println(Math.abs((date2.getTime() - date1.getTime()) + 12) / (24*3600*1000L));
    }

}

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		doIt2();
	}
	static void doIt2(){
		GregorianCalendar gc1, gc2;
		int fyear, fmonth, fday, tyear, tmonth, tday;
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] ss = s.split(":");
		fyear = Integer.parseInt(ss[0]);
		fmonth = Integer.parseInt(ss[1]);
		fday = Integer.parseInt(ss[2]);
		s = sc.next();
		ss = s.split(":");
		tyear = Integer.parseInt(ss[0]);
		tmonth = Integer.parseInt(ss[1]);
		tday = Integer.parseInt(ss[2]);
		gc1 = new GregorianCalendar(fyear, fmonth-1, fday);
		gc2 = new GregorianCalendar(tyear, tmonth-1, tday);
		long result = Math.abs(gc1.getTimeInMillis() - gc2.getTimeInMillis());
		long div = 24 * 60 * 60 * 1000;
		//if(result % div == 0) System.out.println("aaa");
		result /= div;
		System.out.println(result);
	}
}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class B304 {

    public BufferedReader in;
    public StringTokenizer tok;

    public String nextString() throws Exception{
        while(!tok.hasMoreElements()){
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public int nextInt() throws Exception{
        return Integer.parseInt(nextString());
    }

    public void init() throws Exception{
        in = new BufferedReader(new InputStreamReader(System.in));
        tok = new StringTokenizer("");
        solve();
    }

    public int getAllV(int st, int en){
        int res = 0;
        for (int i = st; i <= en; i++) {
            if (i%4 == 0){
                if (i%100 == 0){
                    if (i%400 == 0) res++;
                } else res++;
            }
        }
        return res;
    }

    public int monthDays(int ms,int me, int ys,int ye){
        int days = 0;
        for (int k = ys; k < ye; k++) {
            if (k%4 == 0){
                if (k%100 == 0){
                    if (k%400 == 0) days++;
                } else days++;
            }

            for (int i = 1; i <= 12; i++) {
                if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
                 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                    else days += 28;
            }
        }
        for (int i = ms; i <= me; i++) {
            if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
             else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                else days += 28;
        }
        return days;
    }

    public void solve() throws Exception{
        String d1 = nextString();
        String d2 = nextString();
        String tmp;
        int pldays= 0;
        int year1,year2;
        int month1,month2;
        int day1,day2;

        year1 = Integer.valueOf(d1.substring(0,4));
        year2 = Integer.valueOf(d2.substring(0,4));
        if (year1 > year2) {
            tmp = d1;
            d1 = d2;
            d2 = tmp;
        }
        /*month1 = Integer.valueOf(start.substring(5,7));
        month2 = Integer.valueOf(finish.substring(5,7));
        day1 = Integer.valueOf(start.substring(8,10));
        day2 = Integer.valueOf(finish.substring(8,10));

        if (year1 > year2){
            year2 = Integer.valueOf(start.substring(0,4));
            year1 = Integer.valueOf(finish.substring(0,4));
            month2 = Integer.valueOf(start.substring(5,7));
            month1 = Integer.valueOf(finish.substring(5,7));
            day2 = Integer.valueOf(start.substring(8,10));
            day1 = Integer.valueOf(finish.substring(8,10));
        }

        //year1 = ((year2-year1)*12)-1;
    */

        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d1);
            date2 = format.parse(d2);
        } catch (Exception e) {

        }

        long difference = date2.getTime()-date1.getTime();
        long days = difference / (24 * 60 * 60 * 1000);
        if(days<50000)
            days++;
        System.out.println(days);

        /*
        day1 = Math.abs(day2-day1);
        System.out.println((monthDays(month1,month2,year1,year2)));
        */
    }

    public static void main(String[] args) throws Exception {
        new B304().init();
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class B_304 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(
				System.in)));
		String []from = sc.next().split(":");
		String []to = sc.next().split(":");

		int daysCount = 0;

		int fromYear = Integer.parseInt(from[0]);
		int fromMonth = Integer.parseInt(from[1]);
		int fromDat = Integer.parseInt(from[2]);
		int toYear = Integer.parseInt(to[0]);
		int toMonth = Integer.parseInt(to[1]);
		int toDay = Integer.parseInt(to[2]);

		if(fromYear > toYear || ((fromYear == toYear &&
				fromMonth >toMonth) || fromMonth == toMonth && fromDat > toDay)
				) {
			int tmp = fromYear;
			fromYear = toYear;
			toYear = tmp;
			tmp = fromMonth;
			fromMonth = toMonth;
			toMonth = tmp;
			tmp = fromDat;
			fromDat = toDay;
			toDay = tmp;
		}

		while(fromYear < toYear) {
			if(fromYear%400 ==0) {
				daysCount+=366;
			} else if(fromYear%100 ==0 || fromYear%4 != 0) {
				daysCount+=365;
			} else if(fromYear%4==0) {
				daysCount+=366;
			}
			fromYear++;
		}
		List<Integer> thirtyOneMonths = Arrays.asList(1,3,5,7,8,10,12);
		while(fromMonth <toMonth) {
			if(thirtyOneMonths.contains(fromMonth))
				daysCount+=31;
			else if(fromMonth == 2 && fromYear%400==0 ) {
				daysCount +=29;
			} else if(fromMonth == 2 && (fromYear%100==0 || fromYear%4!=0)) {
				daysCount +=28;
			} else if(fromMonth == 2 ) {
				daysCount +=29;
			} else {
				daysCount+=30;
			}
			fromMonth++;
		}

		while(toMonth <fromMonth) {
			if(thirtyOneMonths.contains(fromMonth))
				daysCount-=31;
			else if(fromMonth == 2 && fromYear%400==0 ) {
				daysCount -=29;
			} else if(fromMonth == 2 && (fromYear%100==0 || fromYear%4!=0)) {
				daysCount -=28;
			} else if(fromMonth == 2 ) {
				daysCount -=29;
			} else {
				daysCount-=30;
			}
			fromMonth--;
		}

		if(fromDat <toDay)
			daysCount += toDay-fromDat;
		else if(toDay < fromDat)
			daysCount -= fromDat -toDay;

		System.out.println(daysCount);
	}

}

import java.io.*;
import java.util.*;

public class Problems1 {

    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        //int n = Integer.parseInt(r.readLine());
        StringTokenizer in= new StringTokenizer(r.readLine(),":");
        int m[]={0,31,59,90,120,151,181,212,243,283,304,334,365};
        int y1,m1,d1,y2,m2,d2,f1,f2;

        y1=Integer.parseInt(in.nextToken());
        m1=Integer.parseInt(in.nextToken());
        d1=Integer.parseInt(in.nextToken());

        in= new StringTokenizer(r.readLine(),":");

        y2=Integer.parseInt(in.nextToken());
        m2=Integer.parseInt(in.nextToken());
        d2=Integer.parseInt(in.nextToken());

        f1=y1*365+m[m1-1]+d1;
        f2=y2*365+m[m2-1]+d2;

        for(int i=1;i<y1;i++){
            if(i%4==0){
                if(i%100!=0 || (i%100==0 && i%400==0))f1++;
            }
        }

        for(int i=1;i<y2;i++){
            if(i%4==0){
                if(i%100!=0 || (i%100==0 && i%400==0))f2++;
            }

        }
        if(m1>2){
            if(y1%4==0){
                if(y1%100!=0 || (y1%100==0 && y1%400==0))f1++;
            }
        }
        if(m2>2){
            if(y2%4==0){
                if(y2%100!=0 || (y2%100==0 && y2%400==0))f2++;
            }
        }

        System.out.println(Math.abs(f1-f2));

    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {

    public static void main(String arg[]) throws IOException
    {

        boolean leap[]=new boolean[2039];

        for(int i=1900;i<=2038;i++)
        {
            if((i%4==0&&i%100!=0))
            {

            leap[i]=true;

            }

        }

        leap[2000]=true;
        int d[]=new int[13];
       d[1]=d[3]=d[5]=d[7]=d[12]=d[10]=d[8]=31;
       d[4]=d[6]=d[9]=d[11]=30;
       d[2]=28;

 //   BufferedReader r=new BufferedReader(new FileReader("testcase.txt"));
   BufferedReader r=new BufferedReader(new InputStreamReader(System.in));

   String s=r.readLine();
   s=s.replaceAll(":", " ");
   StringTokenizer str=new StringTokenizer(s);

int y1=Integer.parseInt(str.nextToken());
int m1=Integer.parseInt(str.nextToken());
int d1=Integer.parseInt(str.nextToken());
s=r.readLine();
   s=s.replaceAll(":", " ");

str=new StringTokenizer(s);
int y2=Integer.parseInt(str.nextToken());
int m2=Integer.parseInt(str.nextToken());
int d2=Integer.parseInt(str.nextToken());

if(y1>y2||(y1==y2&&m1>m2)||(y1==y2&&m1==m2&&d1>d2))
{
   int t=y2;
    y2=y1;
    y1=t;
    t=m2;
    m2=m1;
    m1=t;
    t=d2;
    d2=d1;
    d1=t;
}

int days=0;
for(int i=y1+1;i<y2;i++)
{

    if(leap[i])
    {
        days=days+366;
    }
    else
        days=days+365;

}

for(int i=m1+1;i<=12;i++)
{
    days+=d[i];
}

for(int i=1;i<m2;i++)
{
    days=days+d[i];
}

if(m1<=2&&leap[y1])
{
    days++;

}
if(m2>2&&leap[y2])
{
    days++;
}
days=days+d[m1]-d1;
days=days+d2;
System.out.println(days);

}
    }

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class B304 {

	public BufferedReader in;
	public StringTokenizer tok;

	public String nextString() throws Exception{
		while(!tok.hasMoreElements()){
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws Exception{
		return Integer.parseInt(nextString());
	}

	public void init() throws Exception{
		in = new BufferedReader(new InputStreamReader(System.in));
		tok = new StringTokenizer("");
		solve();
	}
	/*
	 ������ ���, ������� ������� �� ������ ��� �������, �������� ����������, �� ����������� �����,
	 ������� ������� �� 100 ��� �������. ���� ���������� ���� �������
	 �� 400, �� ��� ��� �� �������� �����������. ��������, 1900 ��� �� ����������, � 2000 ����������.
	 */
	public int getAllV(int st, int en){
		int res = 0;
		for (int i = st; i <= en; i++) {
			if (i%4 == 0){
				if (i%100 == 0){
					if (i%400 == 0) res++;
				} else res++;
			}
		}
		return res;
	}

	public int monthDays(int ms,int me, int ys,int ye){
		int days = 0;
		for (int k = ys; k < ye; k++) {
			if (k%4 == 0){
				if (k%100 == 0){
					if (k%400 == 0) days++;
				} else days++;
			}

			for (int i = 1; i <= 12; i++) {
				if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
				 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
			 		else days += 28;
			}
		}
		for (int i = ms; i <= me; i++) {
			if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
			 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
		 		else days += 28;
		}
		return days;
	}

	public void solve() throws Exception{
		String d1 = nextString();
		String d2 = nextString();
		SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
		String tmp;
		int pldays= 0;
		int year1,year2;
		int month1,month2;
		int day1,day2;

		year1 = Integer.valueOf(d1.substring(0,4));
		year2 = Integer.valueOf(d2.substring(0,4));
		if (year1 > year2) {
			tmp = d1;
			d1 = d2;
			d2 = tmp;
		}
		/*month1 = Integer.valueOf(start.substring(5,7));
		month2 = Integer.valueOf(finish.substring(5,7));
		day1 = Integer.valueOf(start.substring(8,10));
		day2 = Integer.valueOf(finish.substring(8,10));

		if (year1 > year2){
			year2 = Integer.valueOf(start.substring(0,4));
			year1 = Integer.valueOf(finish.substring(0,4));
			month2 = Integer.valueOf(start.substring(5,7));
			month1 = Integer.valueOf(finish.substring(5,7));
			day2 = Integer.valueOf(start.substring(8,10));
			day1 = Integer.valueOf(finish.substring(8,10));
		}

		//year1 = ((year2-year1)*12)-1;
	*/
		pldays = getAllV(year1, year2);

		Date date1 = null;
		Date date2 = null;
		try {
		    date1 = format.parse(d1);
		    date2 = format.parse(d2);
		} catch (Exception e) {

		}

		long difference = date1.getTime()-date2.getTime();
		long days =  difference / (24 * 60 * 60 * 1000);
		System.out.println(Math.abs(days)+pldays);
		/*
		day1 = Math.abs(day2-day1);
		System.out.println((monthDays(month1,month2,year1,year2)));*/
	}

	public static void main(String[] args) throws Exception {
		new B304().init();
	}

}

import com.sun.org.apache.bcel.internal.generic.SWAP;

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Calendar {
    public static void main(String[] args) {

        FastReader in = new FastReader();
        OutputStream outputStream = System.out;
        PrintWriter out = new PrintWriter(outputStream);
        int i,j,a = 0,a1 = 0, b1 = 0,b = 0,c1 = 0,c = 0,n,k,l,m;
        String s,s1,s2;
        char x;
        long sum = 0;
        int[] brr = new int[1];
        int[] arr = new int[1];
        //mergeSort(arr, 0, 7);
        //Arrays.binarySearch(arr,7);

        s = in.next();
        s1 = in.next();

        i = 0;
            while (s.charAt(i) != ':'){

                a = a*10 + (s.charAt(i) - 48);
                a1 = a1*10 +  (s1.charAt(i) - 48);
                i++;

            }

            i++;

            while (s.charAt(i) != ':'){

                b = b*10 + (s.charAt(i) - 48);
                b1 = b1*10 + (s1.charAt(i) - 48);
                i++;

            }
            i++;

            while (i < s.length()){
                c = c*10 + (s.charAt(i) - 48);
                c1 = c1*10 + (s1.charAt(i) - 48);
                i++;

            }

//        out.print(a +" " + b + " " + c + "\n");
//        out.println(a1 + " " + b1 + " " + c1);

        if (a1 > a){

        }
        else if (a > a1){

            n = a;
            a = a1;
            a1 = n;

            n = b;
            b = b1;
            b1 = n;

            n = c;
            c = c1;
            c1 = n;
        }
        else {

            if (b < b1){

                if (leap_year(a) == 1 && b <= 2){
                    m = month_day(b);
                    sum += (m - c + 1);
                }
                else {
                    m = month_day(b);
                    sum += (m - c);
                }

                //out.println(sum + " before month");
                b++;
                for (i=b; i<b1; i++){

                    sum += (month_day(i));

                }

                sum += c1;

                out.println(sum);
                out.flush();
                return;
            }

            if (b > b1){

                n = b;
                b = b1;
                b1 = n;

                n = c;
                c = c1;
                c1 = n;

                if (leap_year(a) == 1 && b <= 2){
                    m = month_day(b);
                    sum += (m - c + 1);
                }
                else {
                    m = month_day(b);
                    sum += (m - c);
                }

               // out.println(sum + " before month");
                b++;
                for (i=b; i<b1; i++){

                    sum += (month_day(i));

                }

                sum += c1;

                out.println(sum);
                out.flush();
                return;
            }
            else {
                out.println(Math.abs(c1-c));
                out.flush();
                return;
            }

        }

            if (leap_year(a) == 1 && b <= 2){
                m = month_day(b);
                sum += (m - c + 1);
            }
            else {
                m = month_day(b);
                sum += (m - c);
            }

           // out.println(sum + " before month");
            b++;
            for (i=b; i<=12; i++){

                sum += (month_day(i));

            }

            a ++;

            for (i=a; i<a1; i++){

                if (leap_year(i) == 1)
                    sum += 366;
                else
                    sum += 365;

            }

            if (leap_year(a1) == 1 && b1 >= 3){
                sum += (1 + c1);
            }
            else sum += c1;

            for (i=1; i<b1; i++){
             sum += (month_day(i)) ;
            }

            out.println(sum);

        out.flush();

    }

    static int leap_year(int v){
        if (v % 400 == 0){
            return 1;
        }
        else if (v % 100 == 0)
            return 0;
        else if (v % 4 == 0)
            return 1;
        else return 0;
    }

    static int month_day(int v){

        if (v == 1)
            return 31;
        else if (v == 2)
            return 28;
        else if (v == 3)
            return 31;
        else if (v == 4)
            return 30;
        else if (v == 5)
            return 31;
        else if (v == 6)
            return 30;
        else if (v == 7)
            return 31;
        else if (v == 8)
            return 31;
        else if (v == 9)
            return 30;
        else if (v == 10)
            return 31;
        else if (v == 11)
            return 30;
       else
            return 31;

    }

    static void  mergeSort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Same as (l+r)/2, but avoids overflow for
            // large l and h
            int m = l+(r-l)/2;

            // Sort first and second halves
            mergeSort(arr, l, m);
            mergeSort(arr, m+1, r);

            merge(arr, l, m, r);
        }
    }

    static void merge(int arr[], int l, int m, int r)
    {
        int i, j, k;
        int n1 = m - l + 1;
        int n2 =  r - m;

        /* create temp arrays */
        int L[] = new int[n1],  R[] = new int[n2];

        /* Copy data to temp arrays L[] and R[] */
        for (i = 0; i < n1; i++)
            L[i] = arr[l + i];
        for (j = 0; j < n2; j++)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays back into arr[l..r]*/
        i = 0; // Initial index of first subarray
        j = 0; // Initial index of second subarray
        k = l; // Initial index of merged subarray
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

    /* Copy the remaining elements of L[], if there
       are any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

    /* Copy the remaining elements of R[], if there
       are any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.io.IOException;
import java.util.InputMismatchException;

public class Calendar {
	private static final int[][] DAYS = new int[2039][13];
	static {
        for (int y = 1990; y < DAYS.length; y++) {
        	for (int m = 1; m <= 12; m++) {
        		if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
        			DAYS[y][m] = 31;
        		} else if (m == 4 || m == 6 || m == 9 || m == 11) {
        			DAYS[y][m] = 30;
        		} else {
        			if (y % 400 == 0) {
        				DAYS[y][m] = 29;
        			} else if (y % 100 == 0) {
        				DAYS[y][m] = 28;
        			} else if (y % 4 == 0) {
        				DAYS[y][m] = 29;
        			} else {
        				DAYS[y][m] = 28;
        			}
        		}
        	}
        }
	}

    public static void main(String[] args) {
        FasterScanner sc = new FasterScanner();

        String D1 = sc.nextString();
        String D2 = sc.nextString();

        int[] date1 = parseDate(D1);
        int[] date2 = parseDate(D2);

        int days1 = getDays(date1);
        int days2 = getDays(date2);

        System.out.println(Math.abs(days2 - days1));
    }

    public static int getDays(int[] date) {
    	int cnt = date[2];
    	for (int y = 1990; y <= date[0]; y++) {
    		for (int m = 1; m <= 12; m++) {
    			if (y == date[1] && m == date[1]) {
    				break;
    			}
    			cnt += DAYS[y][m];
    		}
    	}
    	return cnt;
    }

    public static int[] parseDate(String date) {
    	String[] tmp = date.split(":");
    	int[] arr = new int[3];
    	for (int i = 0; i < 3; i++) {
    		arr[i] = Integer.parseInt(tmp[i]);
    	}
    	return arr;
    }

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

	    public int[] nextIntArray(int n) {
	        int[] arr = new int[n];
	        for (int i = 0; i < n; i++) {
	            arr[i] = nextInt();
	        }
	        return arr;
	    }

		public long[] nextLongArray(int n) {
		    long[] arr = new long[n];
		    for (int i = 0; i < n; i++) {
		        arr[i] = nextLong();
		    }
		    return arr;
		}

	    private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}

import java.io.*;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

public class Main {
    static void zap() throws IOException {
        String date = nextToken();
        int yy = Integer.parseInt(date.substring(0,0+4));
        int mm = Integer.parseInt(date.substring(5,5+2));
        int dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c1 = new GregorianCalendar();
        c1.set(yy,mm-1,dd);
        date = nextToken();
        yy = Integer.parseInt(date.substring(0,0+4));
        mm = Integer.parseInt(date.substring(5,5+2));
        dd = Integer.parseInt(date.substring(8,8+2));
        GregorianCalendar c2 = new GregorianCalendar();
        c2.set(yy,mm-1,dd);
        long s = Math.abs(c2.getTimeInMillis() - c1.getTimeInMillis());
        out.println(s/(24 * 3600 * 1000));
    }

    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        InputStream input = System.in;
        //InputStream input = new FileInputStream("fileIn.in");
        OutputStream output = System.out;
        //OutputStream output = new FileOutputStream("fileOut.out");
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        zap();
        out.close();
    }

    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

/**
 * Recordar la clase simpleFormar
 * */
public class B_Div2_183 {
    public static void main(String[]arg) throws IOException
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String line = in.readLine();
        int yy = Integer.parseInt(line.substring(0, 4));
        int mm = Integer.parseInt(line.substring(5, 7));
        int dd = Integer.parseInt(line.substring(8, 10));
        Calendar cIni = new GregorianCalendar();
        cIni.set(yy, mm-1, dd);
        String lines = in.readLine();
        int y1 = Integer.parseInt(lines.substring(0, 4));
        int m1 = Integer.parseInt(lines.substring(5, 7));
        int d1 = Integer.parseInt(lines.substring(8, 10));
        Calendar cFin = new GregorianCalendar();
        cFin.set(y1, m1-1, d1);
        if(cFin.before(cIni))
        {
            Calendar temp = cFin;
            cFin = cIni;
            cIni = temp;//s
        }
        int days = 0;
        for(;cIni.before(cFin);cIni.add(Calendar.DAY_OF_MONTH,1))
            days++;
        System.out.println(days);
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author MDPC-X
 */
public class Calendar304 {

    public static void main(String[] args) throws Exception {
        HashMap<Integer, Integer> months = new HashMap<Integer, Integer>();
        months.put(0, 0);
        months.put(1, 31);
        months.put(2, 59);
        months.put(3, 90);
        months.put(4, 120);
        months.put(5, 151);
        months.put(6, 181);
        months.put(7, 212);
        months.put(8, 243);
        months.put(9, 273);
        months.put(10, 304);
        months.put(11, 334);
        months.put(12, 365);

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] firstDate = in.readLine().split(":");
        String[] secondDate = in.readLine().split(":");

        int totaldays1, totaldays2, yeardiff1, yeardiff2, yeardiff3;
        int month1, month2, day1, day2;
        month1 = Integer.parseInt(firstDate[1]);
        month2 = Integer.parseInt(secondDate[1]);
        day1 = Integer.parseInt(firstDate[2]);
        day2 = Integer.parseInt(secondDate[2]);

        totaldays1 = Integer.parseInt(firstDate[0]) * 365 + months.get(Integer.parseInt(firstDate[1]) - 1) + Integer.parseInt(firstDate[2]);
        totaldays2 = Integer.parseInt(secondDate[0]) * 365 + months.get(Integer.parseInt(secondDate[1]) - 1) + Integer.parseInt(secondDate[2]);
        //System.out.println(totaldays2 - totaldays1 + "sdasd");

        yeardiff1 = Integer.parseInt(secondDate[0]) / 4 - Integer.parseInt(firstDate[0]) / 4;
        yeardiff2 = Integer.parseInt(secondDate[0]) / 100 - Integer.parseInt(firstDate[0]) / 100;
        yeardiff3 = Integer.parseInt(secondDate[0]) / 400 - Integer.parseInt(firstDate[0]) / 400;
        yeardiff1 = yeardiff1 - yeardiff2 + yeardiff3;

        int sum = Math.abs(totaldays1 - totaldays2) + Math.abs(yeardiff1);
        /*
        if (month1 > 2)
            sum--;
        if (month2 > 2);
            sum--;
         */

        //System.out.println(sum + "original\n");
//        if (month1 > 2 || (month1 == 2 && day1 >= 28)) {
//            sum++;
//        }
        if (month2 > 2 || (month2 == 2 && day2 >= 28)) {
            sum--;
            if (month1 < 2 || (month1 == 2 && month1 >= 28)) {
                sum++;
            }
        }

        System.out.println(sum);
        in.close();

    }
}

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String s1 = scan.next();
		String s2 = scan.next();

		int y1 = Integer.parseInt(s1.substring(0, 4));
		int y2 = Integer.parseInt(s2.substring(0, 4));
		int m1 = Integer.parseInt(s1.substring(5, 7));
		int m2 = Integer.parseInt(s2.substring(5, 7));
		int d1 = Integer.parseInt(s1.substring(8));
		int d2 = Integer.parseInt(s2.substring(8));

		if (y1 > y2) {
			int temp = y1;
			y1 = y2;
			y2 = temp;
			temp = m1;
			m1 = m2;
			m2 = temp;
			temp = d1;
			d1 = d2;
			d2 = temp;
		} else if (y1 == y2) {
			if (m1 == m2) {
				if (d1 > d2) {
					int temp = y1;
					y1 = y2;
					y2 = temp;
					temp = m1;
					m1 = m2;
					m2 = temp;
					temp = d1;
					d1 = d2;
					d2 = temp;
				}
				if (d1 == d2) {
					System.out.println(0);
					System.exit(0);
				}
			} else if (m1 > m2) {
				int temp = y1;
				y1 = y2;
				y2 = temp;
				temp = m1;
				m1 = m2;
				m2 = temp;
				temp = d1;
				d1 = d2;
				d2 = temp;
			}
		}

		int total = 0;
		for (int i = m1; i <= 12; i++) {
			if (i == 2)
				total += 28;
			else if (i <= 7) {
				if (i % 2 == 0)
					total += 30;
				else
					total += 31;
			} else {
				if (i % 2 != 0)
					total += 30;
				else
					total += 31;
			}
		}
		total -= (d1 - 1);
		if (isLeap(y1) && m1 <= 2) {
			total++;
		}
		for (int i = y1 + 1; i < y2; i++) {
			if (isLeap(i))
				total += 366;
			else
				total += 365;
		}
		for (int i = 1; i < m2; i++) {
			if (i == 2)
				total += 28;
			else if (i <= 7) {
				if (i % 2 == 0)
					total += 30;
				else
					total += 31;
			} else {
				if (i % 2 != 0)
					total += 30;
				else
					total += 31;
			}
		}
		total += d2 - 1;
		if (isLeap(y2) && m2 > 2)
			total++;

		System.out.println(total);

		scan.close();
	}

	public static boolean isLeap(int y) {
		if (y % 4 == 0) {
			if (y % 100 == 0) {
				if (y % 400 == 0)
					return true;
				return false;
			}
			return true;
		}
		return false;
	}
}

import java.util.*; //Scanner, Calendar
import java.io.PrintWriter; //PrintWriter

public class ND_R183_Div2_B
{
	public static void main(String[] args) {
		Scanner      in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		solve(in, out);
		out.close();
		in.close();
	}

	public static void solve(Scanner in, PrintWriter out)
	{
		String[] s = in.next().split(":");
		int y1 = Integer.parseInt(s[0]);
		int m1 = Integer.parseInt(s[1]);
		int d1 = Integer.parseInt(s[2]);

		s = in.next().split(":");
		int y2 = Integer.parseInt(s[0]);
		int m2 = Integer.parseInt(s[1]);
		int d2 = Integer.parseInt(s[2]);

		//Date dt1 = new Date(m1, d1, y1);  //deprecated, so use Calendar
		Calendar dt1 = new GregorianCalendar();
		Calendar dt2 = new GregorianCalendar();
		Calendar t = new GregorianCalendar();
		dt1.set(y1, m1, d1);
		dt2.set(y2, m2, d2);
		if (dt2.compareTo(dt1) > 0)
		{
			t = dt1; dt1 = dt2; dt2 = t;
		}
		long diff = Math.abs(dt2.getTimeInMillis() - dt1.getTimeInMillis());
		long diffDays = diff / (24 * 60 * 60 * 1000);

		out.println(diffDays);
	}
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;

public class cf304b {

    static BufferedReader br;
    static Scanner sc;
    static PrintWriter out;

    public static void initA() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            //br = new BufferedReader(new FileReader("input.txt"));
            sc = new Scanner(System.in);
            //out = new PrintWriter("output.txt");
            out = new PrintWriter(System.out);
        } catch (Exception e) {
        }
    }

    static boolean next_permutation(Integer[] p) {
        for (int a = p.length - 2; a >= 0; --a) {
            if (p[a] < p[a + 1]) {
                for (int b = p.length - 1;; --b) {
                    if (p[b] > p[a]) {
                        int t = p[a];
                        p[a] = p[b];
                        p[b] = t;
                        for (++a, b = p.length - 1; a < b; ++a, --b) {
                            t = p[a];
                            p[a] = p[b];
                            p[b] = t;
                        }
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public static void initB() {
        try {

            br = new BufferedReader(new FileReader("input.txt"));
            sc = new Scanner(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");

        } catch (Exception e) {
        }
    }

    public static String getString() {
        try {
            return br.readLine();
        } catch (Exception e) {
        }
        return "";
    }

    public static Integer getInt() {
        try {
            return Integer.parseInt(br.readLine());
        } catch (Exception e) {
        }
        return 0;
    }

    public static Integer[] getIntArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Integer temp2[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Integer.parseInt(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Long[] getLongArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Long temp2[] = new Long[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Long.parseLong(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static String[] getStringArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            String temp2[] = new String[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = (temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static int getMax(Integer[] ar) {
        int t = ar[0];
        for (int i = 0; i < ar.length; i++) {
            if (ar[i] > t) {
                t = ar[i];
            }
        }
        return t;
    }

    public static void print(Object a) {
        out.println(a);
    }

    public static void print(String s, Object... a) {
        out.printf(s, a);
    }

    public static int nextInt() {
        return sc.nextInt();
    }

    public static double nextDouble() {
        return sc.nextDouble();
    }

    public static void main(String[] ar) throws Exception {
        initA();
        solve();
        out.flush();
    }

    static boolean kabisat(int tahun) {
        if (tahun % 100 == 0 && tahun % 400 > 0) {
            return false;
        }
        if (tahun % 4 == 0) {
            return true;
        } else {
            return false;
        }
    }

    static int getHari(int bulan, int tahun) {
        if(bulan > 7){
            if(bulan % 2 == 0){
                return 31;
            }else{
                return 30;
            }
        }

        if (bulan % 2 == 1) {
            return 31;
        } else {
            if (bulan == 2) {
                if (kabisat(tahun)) {
                    return 29;
                } else {
                    return 28;
                }
            } else {
                return 30;
            }
        }
    }

    static int getHari(int tahun) {
        if (kabisat(tahun)) {
            return 366;
        } else {
            return 365;
        }
    }

    public static void solve() throws Exception {
        String a = getString();
        String b = getString();

        int ta = Integer.valueOf(a.replace(":", ""));
        int tb = Integer.valueOf(b.replace(":", ""));

        if (ta > tb) {
            String temp = a;
            a = b;
            b = temp;
        }
        //print(a);
        //print(b);
        String p[] = a.split(":");

        String p2[] = b.split(":");

        int th = Integer.valueOf(p[0]), bulan = Integer.valueOf(p[1]), hari = Integer.valueOf(p[2]);
        int th2 = Integer.valueOf(p2[0]), bulan2 = Integer.valueOf(p2[1]), hari2 = Integer.valueOf(p2[2]);

        int ou = 0;
        int last = 0;

        while (th != th2 || bulan != bulan2 || hari != hari2) {
            if (th2 - th > 1) {
                ou += getHari(th);
                th++;
            } else {
                if (th == th2) {
                    int k = 0;
                    while (bulan < bulan2) {
                        ou += getHari(bulan, th);
                        k+=getHari(bulan,th);
                        //print("bulan ke %d tahun %d jml harinya: %d\n", bulan, th, getHari(bulan,th));
                        bulan++;
                    }
                                //print("%d:%d:%d %d\n", th, bulan, hari, ou);
                    if (hari < hari2) {
                        ou += hari2 - hari;
                        hari = hari2;
                    }
                    if (hari > hari2) {
                        ou -= hari - hari2;
                        hari = hari2;
                    }
                }
                if (th2 - th == 1) {
                    while (bulan <= 12) {
                        ou += getHari(bulan, th);
                        //print("bulanX ke %d tahun %d jml harinya: %d\n", bulan, th, getHari(bulan,th));
                        bulan++;
                    }
                    th++;
                    bulan = 1;
                }

            }
            //print("%d:%d:%d %d\n", th, bulan, hari, ou);
            //print("bertambah %d hari\n", ou -last);
            last= ou;

        }
        print(ou);

    }
}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class D {

    public static int daysBetween(Date d1, Date d2){
        int milli = 1000 * 60 * 60 * 24;
        return (int) Math.round( (d2.getTime() / milli) - (d1.getTime() / milli) );
     }

    public static void main(String[] args)throws Exception {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        GregorianCalendar onee = new GregorianCalendar();
        GregorianCalendar twoo = new GregorianCalendar();

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");

        Date date = sdf.parse(read.readLine());
        onee.setTime(date);
        date = sdf.parse(read.readLine());
        twoo.setTime(date);
        int ans = Math.abs(daysBetween(onee.getTime(),twoo.getTime()));
        System.out.println(ans);
    }
}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        String year1, year2 , t;
        Scanner scan = new Scanner(System.in);
        year1 = scan.next();
        year2 = scan.next();
        if(year1.compareTo(year2) == 1)
        {
            t = year1 ;
            year1 = year2 ;
            year2 = t ;
        }
        Calendar cal1 = new GregorianCalendar();
        Calendar cal2 = new GregorianCalendar();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");
        Date date;
        try {
            date = sdf.parse(year1);
            cal1.setTime(date);
            date = sdf.parse(year2);
            cal2.setTime(date);
            long a = daysBetween(cal1.getTime(), cal2.getTime());
            System.out.println(Math.abs(a));
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }

    public static long daysBetween(Date d1, Date d2) {
        return ((d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
    }
}

import java.io.*;
import java.util.*;
import java.text.*;

public class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(new InputStreamReader(System.in));
        PrintWriter out=new PrintWriter(System.out);
        String d1 = in.nextLine();
        String d2 = in.nextLine();
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d2);
            date2 = format.parse(d1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        long difference = date1.getTime()/ 24/60/60/1000 - date2.getTime()/ 24/60/60/1000+1;
        long days = difference ;
        out.println(Math.abs(days));

        in.close();
        out.close();
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class B_304 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(
				System.in)));
		String []from = sc.next().split(":");
		String []to = sc.next().split(":");

		int daysCount = 0;

		int fromYear = Integer.parseInt(from[0]);
		int fromMonth = Integer.parseInt(from[1]);
		int fromDat = Integer.parseInt(from[2]);
		int toYear = Integer.parseInt(to[0]);
		int toMonth = Integer.parseInt(to[1]);
		int toDay = Integer.parseInt(to[2]);

		if(fromYear > toYear || ((fromYear == toYear &&
				fromMonth >toMonth) || fromMonth == toMonth && fromDat > toDay)
				) {
			int tmp = fromYear;
			fromYear = toYear;
			toYear = tmp;
			tmp = fromMonth;
			fromMonth = toMonth;
			toMonth = tmp;
			tmp = fromDat;
			fromDat = toDay;
			toDay = tmp;
		}

		while(fromYear < toYear) {
			fromYear++;
			if(fromYear%400 ==0) {
				daysCount+=366;
			} else if(fromYear%100 ==0 || fromYear%4 != 0) {
				daysCount+=365;
			} else if(fromYear%4==0) {
				daysCount+=366;
			}

		}
		List<Integer> thirtyOneMonths = Arrays.asList(1,3,5,7,8,10,12);
		while(fromMonth <toMonth) {

			if(thirtyOneMonths.contains(fromMonth))
				daysCount+=31;
			else if(fromMonth == 2 && fromYear%400==0 ) {
				daysCount +=29;
			} else if(fromMonth == 2 && (fromYear%100==0 || fromYear%4!=0)) {
				daysCount +=28;
			} else if(fromMonth == 2 ) {
				daysCount +=29;
			} else {
				daysCount+=30;
			}
			fromMonth++;
		}

		while(toMonth <fromMonth) {
			fromMonth--;
			if(thirtyOneMonths.contains(fromMonth))
				daysCount-=31;
			else if(fromMonth == 2 && fromYear%400==0 ) {
				daysCount -=29;
			} else if(fromMonth == 2 && (fromYear%100==0 || fromYear%4!=0)) {
				daysCount -=28;
			} else if(fromMonth == 2 ) {
				daysCount -=29;
			} else {
				daysCount-=30;
			}

		}

			if(fromDat <toDay)
				daysCount += toDay-fromDat;
			else if(toDay < fromDat)
				daysCount -= fromDat -toDay;

		System.out.println(daysCount);
	}

	static boolean isBoundry(int year, int month, int day, List<Integer> thirtyOneMonths) {
		if(month==2 && (year%400==0 || (year%100!=0 && year%4==0) )) {
			return day == 29;
		}
		if(month == 2)
			return day==28;
		if(thirtyOneMonths.contains(month))
			return day==31;
		return day==30;
	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.StringTokenizer;
import java.util.TimeZone;

public class CalendarProb {
    public static void main(String[] args) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");

//        format.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));

        String s1 = next();
        String s2 = next();

        long d1 = format.parse(s1).getTime();
        long d2 = format.parse(s2).getTime();

        long res = d1 - d2;
        res = Math.abs(res);

        writer.println(res / (1000 * 60 * 60 * 24));

        writer.close();
    }

    static PrintWriter writer = new PrintWriter(System.out);

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tokenizer = new StringTokenizer("");

    static String next() {
        while (!tokenizer.hasMoreTokens())
            try {
                tokenizer = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        return tokenizer.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

    static double nextDouble() {
        return Double.parseDouble(next());
    }
}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			else if (y < d1.y)
				return -1;

			if (m > d1.m)
				return 1;
			else if (m < d1.m)
				return -1;

			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		if (d1.m == 2 && d1.d <= 29 && d1.y % 4 ==0 && d1.y > 1900)
			answer--;

		answer += d2.d;
		if (d2.m == 2 && d2.d == 29)
			answer--;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(answer);
	}
}

import java.util.Scanner;

public class Main {
    Scanner scan=new Scanner(System.in);
    public void doIt(){
        int [] month = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

        String s = scan.next();
        String e = scan.next();

        if(s.compareTo(e)> 0 ){
            String tmp = s;
            s = e;
            e = tmp;
        }

        String [] start = s.split(":");
        String [] end = e.split(":");

        int sum = 0;

        int sy = Integer.parseInt(start[0]);
        int sm = Integer.parseInt(start[1]);
        int sd = Integer.parseInt(start[2]);
        int ey = Integer.parseInt(end[0]);
        int em = Integer.parseInt(end[1]);
        int ed = Integer.parseInt(end[2]);

        sum = month[sm] - sd + 1;

        for(int i = sm+1; i<=12; i++){
            sum += month[i];
        }

        for(int i = sy+1; i<ey; i++){
            int set = 365;
            if(intercalary(i))set = 366;
            sum += set;
        }

        for(int i = 1; i<em; i++){
            sum += month[i];
        }

        if(intercalary(ey) && (ed > 3 ))sum += 1;
        if(intercalary(sy) && (sm < 3 ))sum += 1;

        sum += ed-1;
        System.out.println(sum);
    }

    public boolean intercalary(int y){
        if((y % 4 == 0) && ((y % 100 == 0 && y % 400 == 0) || (y % 100 != 0))){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        Main obj = new Main();
        obj.doIt();
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class B {

	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		String[] input1 = sc.next().split(":");
		String[] input2 = sc.next().split(":");

		GregorianCalendar day1 = new GregorianCalendar(Integer.parseInt(input1[0]), Integer.parseInt(input1[1]) - 1, Integer.parseInt(input1[2]));
		GregorianCalendar day2 = new GregorianCalendar(Integer.parseInt(input2[0]), Integer.parseInt(input2[1]) - 1, Integer.parseInt(input2[2]));

		System.out.println(Math.abs(day1.getTimeInMillis() - day2.getTimeInMillis()) / (1000 * 60 * 60 * 24));
	}

	public static class Scanner {

		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException{
			br = new BufferedReader(new InputStreamReader(is));
			getLine();
		}

		private void getLine() throws IOException{
			while(tok == null || !tok.hasMoreTokens()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext(){
			return tok.hasMoreTokens();
		}

		public String next() throws IOException{
			if(hasNext()){
				return tok.nextToken();
			}else{
				getLine();
				return tok.nextToken();
			}
		}

		public int nextInt() throws IOException{
			if(hasNext()){
				return Integer.parseInt(tok.nextToken());
			}else{
				getLine();
				return Integer.parseInt(tok.nextToken());
			}
		}

		public long nextLong() throws IOException{
			if(hasNext()){
				return Long.parseLong(tok.nextToken());
			}else{
				getLine();
				return Long.parseLong(tok.nextToken());
			}
		}

		public double nextDouble() throws IOException{
			if(hasNext()){
				return Double.parseDouble(tok.nextToken());
			}else{
				getLine();
				return Double.parseDouble(tok.nextToken());
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class B {

	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		String[] input1 = sc.next().split(":");
		String[] input2 = sc.next().split(":");

		GregorianCalendar day1 = new GregorianCalendar(Integer.parseInt(input1[0]), Integer.parseInt(input1[1]) - 1, Integer.parseInt(input1[2]) - 1);
		GregorianCalendar day2 = new GregorianCalendar(Integer.parseInt(input2[0]), Integer.parseInt(input2[1]) - 1, Integer.parseInt(input2[2]) - 1);

		System.out.println(Math.abs(day1.getTimeInMillis() - day2.getTimeInMillis()) / (1000 * 60 * 60 * 24));
	}

	public static class Scanner {

		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException{
			br = new BufferedReader(new InputStreamReader(is));
			getLine();
		}

		private void getLine() throws IOException{
			while(tok == null || !tok.hasMoreTokens()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext(){
			return tok.hasMoreTokens();
		}

		public String next() throws IOException{
			if(hasNext()){
				return tok.nextToken();
			}else{
				getLine();
				return tok.nextToken();
			}
		}

		public int nextInt() throws IOException{
			if(hasNext()){
				return Integer.parseInt(tok.nextToken());
			}else{
				getLine();
				return Integer.parseInt(tok.nextToken());
			}
		}

		public long nextLong() throws IOException{
			if(hasNext()){
				return Long.parseLong(tok.nextToken());
			}else{
				getLine();
				return Long.parseLong(tok.nextToken());
			}
		}

		public double nextDouble() throws IOException{
			if(hasNext()){
				return Double.parseDouble(tok.nextToken());
			}else{
				getLine();
				return Double.parseDouble(tok.nextToken());
			}
		}
	}
}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			if (m > d1.m)
				return 1;
			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		answer += d2.d;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(Math.abs(answer));
	}
}

import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;
import java.text.*;

@SuppressWarnings("unchecked")
public class P304B {

  public void run() throws Exception {
    DateFormat df = new SimpleDateFormat("yyyy:MM:dd", Locale.US);
    println(Math.abs(df.parse(next()).getTime() - df.parse(next()).getTime()) / 86_400_000);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P304B().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }

  int gcd(int a, int b) {
    if (a == 0) return Math.abs(b); if (b == 0) return Math.abs(a);
    a = Math.abs(a); b = Math.abs(b);
    int az = Integer.numberOfTrailingZeros(a), bz = Integer.numberOfTrailingZeros(b);
    a >>>= az; b >>>= bz;
    while (a != b) {
      if (a > b) { a -= b; a >>>= Integer.numberOfTrailingZeros(a); }
            else { b -= a; b >>>= Integer.numberOfTrailingZeros(b); }
    }
    return (a << Math.min(az, bz));
  }

  long gcd(long a, long b) {
    if (a == 0) return Math.abs(b); if (b == 0) return Math.abs(a);
    a = Math.abs(a); b = Math.abs(b);
    int az = Long.numberOfTrailingZeros(a), bz = Long.numberOfTrailingZeros(b);
    a >>>= az; b >>>= bz;
    while (a != b) {
      if (a > b) { a -= b; a >>>= Long.numberOfTrailingZeros(a); }
            else { b -= a; b >>>= Long.numberOfTrailingZeros(b); }
    }
    return (a << Math.min(az, bz));
  }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author MDPC-X
 */
public class Calendar304 {

    public static void main(String[] args) throws Exception {
        HashMap<Integer, Integer> months = new HashMap<Integer, Integer>();
        months.put(1, 31); months.put(2, 59); months.put(3, 90); months.put(4, 120);
        months.put(5, 151); months.put(6, 181); months.put(7, 212); months.put(8, 243);
        months.put(9, 273); months.put(10, 304); months.put(11, 334); months.put(12, 365);

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] firstDate = in.readLine().split(":");
        String[] secondDate = in.readLine().split(":");

        int  totaldays1, totaldays2, yeardiff1, yeardiff2,yeardiff3;
        int month1, month2, day1,day2;
        month1 = Integer.parseInt(firstDate[1]);
        month2 = Integer.parseInt(secondDate[1]);
        day1 = Integer.parseInt(firstDate[2]);
        day2 = Integer.parseInt(secondDate[2]);

         totaldays1 = Integer.parseInt(firstDate[0]) * 365 + months.get(Integer.parseInt(firstDate[1])) + Integer.parseInt(firstDate[2]);
         totaldays2 = Integer.parseInt(secondDate[0]) * 365 + months.get(Integer.parseInt(secondDate[1])) + Integer.parseInt(secondDate[2]);

        yeardiff1 = Integer.parseInt(secondDate[0]) / 4 - Integer.parseInt(firstDate[0])  / 4;
        yeardiff2 = Integer.parseInt(secondDate[0]) / 100 - Integer.parseInt(firstDate[0])  / 100;
        yeardiff3 = Integer.parseInt(secondDate[0]) / 400 - Integer.parseInt(firstDate[0])  / 400;
        yeardiff1 = yeardiff1 - yeardiff2 + yeardiff3;

        int sum = Math.abs(totaldays1 - totaldays2) + Math.abs(yeardiff1);
        /*
        if (month1 > 2)
            sum--;
        if (month2 > 2);
            sum--;
        */

        //System.out.println(sum + "original\n");

        if(month1 > 2 || (month1==2 && day1 >= 28))
            sum--;
        if (!(month2 >2 || (month2 == 2 && day2 >= 28)))
            sum++;

        System.out.println(sum);
        in.close();

    }
}

//in the name of god
import java.util.*;
public class calender
{
public static boolean leap(int yr){

if(yr%4==0&&yr%100!=0||yr%400==0)
return true;
return false;
}
public static void main(String[] args){
int m[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int lm[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
Scanner s=new Scanner(System.in);
String a=s.next();/*1932:11:18
2028:09:25*/
String b=s.next();
int ans=0;int o=0;
int ar[]=new int[3];
for(String s1:a.split(":")) {ar[o++]=Integer.parseInt(s1);}
int year1=ar[0];int mon1=ar[1];int day1=ar[2];
o=0;
int h=0;
for(String s1:b.split(":")) {ar[o++]=Integer.parseInt(s1);}
int year2=ar[0];int mon2=ar[1];int day2=ar[2];
if(year1>year2){
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;
}
if(year1==year2){
if(mon1>mon2)
{
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;

}
}
if(year1==year2&&mon1==mon2&&day1>day2){
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;

}

for(int i=year1+1;i<year2;i++)
if(leap(i)) ans+=366;
else
ans+=365;int pls=ans;
//System.out.println(pls);
if(leap(year2))
{for(int i=1;i<mon2;i++)
ans+=lm[i];
}else
{for(int i=1;i<mon2;i++)
ans+=m[i];
}
ans+=day2-1;
int minus=0;
if(leap(year1))
{
for(int i=1;i<mon1;i++)
minus+=lm[i];
minus+=day1-1;
minus=366-minus;
}
else {
for(int i=1;i<mon1;i++)
minus+=m[i];
minus+=day1-1;
minus=365-minus;
}

ans+=minus;
System.out.print(ans);
}
}

/**
 * Created by user on 11/14/2019.
 */

import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class dateProblem {
    public static void main(String[] args) throws IOException, ParseException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(System.out));
        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date start = format.parse(br.readLine());
        Date end = format.parse(br.readLine());
        long diff = end.getTime()-start.getTime();
        diff/=86400000;
        System.out.println(diff);

    }
}

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        DateFormat df = new SimpleDateFormat("yyyy:MM:dd");
        Date d1 = df.parse(s1);
        Date d2 = df.parse(s2);
        System.out.println(Math.abs(d1.getTime()-d2.getTime())/(1000*60*60*24));
    }
}

import java.io.*;
import java.util.*;
public final class round_183_b
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out=new PrintWriter(System.out);

	public static void main(String args[]) throws Exception
	{
		String[] a1=br.readLine().split(":"),a2=br.readLine().split(":"),s1,s2;
		boolean t=false;
		for(int i=0;i<3;i++)
		{
			if(Integer.parseInt(a1[i])>Integer.parseInt(a2[i]))
			{
				t=true;
				break;
			}
			else if(Integer.parseInt(a1[i])<Integer.parseInt(a2[i]))
			{
				break;
			}
		}
		if(!t)
		{
			s1=a1;
			s2=a2;
		}
		else
		{
			s1=a2;
			s2=a1;
		}
		boolean[] leap=new boolean[3000];
		for(int i=1900;i<=2038;i++)
		{
			if((i%4==0 && i%100!=0) || (i%400==0))
			{
				//out.println(i);
				leap[i]=true;
			}
		}
		int[] a=new int[3],b=new int[3];
		for(int i=0;i<3;i++)
		{
			a[i]=Integer.parseInt(s1[i]);
			b[i]=Integer.parseInt(s2[i]);
		}
		//out.println(Arrays.toString(a)+"\n"+Arrays.toString(b));
		long res=0;
		int[] cnt=new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(int i=a[0]+1;i<=b[0]-1;i++)
		{
			res=res+365;
			if(leap[i])
			{
				res++;
			}
		}
		for(int i=a[1]+1;i<=12;i++)
		{
			res=res+cnt[i];
			if(i==2 && leap[a[0]])
			{
				res++;
			}
		}
		for(int i=1;i<=b[1]-1;i++)
		{
			res=res+cnt[i];
			if(i==2 && leap[b[0]])
			{
				res++;
			}
		}
		res=res+(cnt[a[1]]-(a[2]-1))+(b[2]-1);
		if(a[1]==2 && leap[a[0]] && a[2]<=29)
		{
			res++;
		}
		out.println(res);
		out.close();
	}
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

	public String next() throws Exception {
		return nextToken().toString();
	}

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)   throws Exception {

		BufferedReader br =  new BufferedReader(new InputStreamReader(System.in));
		// TODO Auto-generated method stub
		String line[];
		int aa , mm , dd ;
		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]) - 1;
		dd = Integer.parseInt(line[2]);

		GregorianCalendar a =  new GregorianCalendar(aa , mm , dd);

		line  =  br.readLine().split(":");
		aa = Integer.parseInt(line[0]);
		mm = Integer.parseInt(line[1]) - 1;
		dd = Integer.parseInt(line[2]);
		GregorianCalendar b =  new GregorianCalendar(aa , mm, dd);

		 long  res  =   Math.abs(a.getTimeInMillis() - b.getTimeInMillis());
		 b =  new GregorianCalendar();

		long z =  (res /(86400000));

		 System.out.println(z);

	}

}

import java.io.*;
import java.util.*;
import java.text.*;
public final class round_183_b
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out=new PrintWriter(System.out);

	public static void main(String args[]) throws Exception
	{
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy:MM:dd");
		String s1=br.readLine(),s2=br.readLine();
		Date d1=sdf.parse(s1),d2=sdf.parse(s2);
		int ans=0;
		if(d1.compareTo(d2)==0)
		{
			out.println(1);
		}
		else if(d1.compareTo(d2)<0)
		{
			Calendar c1=Calendar.getInstance();
			c1.setTime(d1);
			while(d1.compareTo(d2)<0)
			{
				c1.add(Calendar.DATE,1);
				d1=c1.getTime();
				ans++;
			}
			out.println(ans);
		}
		else
		{
			Calendar c1=Calendar.getInstance();
			c1.setTime(d2);
			while(d2.compareTo(d1)<0)
			{
				c1.add(Calendar.DATE,1);
				d2=c1.getTime();
				ans++;
			}
			out.println(ans);
		}
		out.close();
	}
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

	public String next() throws Exception {
		return nextToken().toString();
	}

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class B {

	public static void main(String[] args) throws IOException, ParseException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String s1 = reader.readLine(), s2 = reader.readLine();

		DateFormat format = new SimpleDateFormat("yyyy:MM:dd");
		Date date1 = format.parse(s1), date2 = format.parse(s2);
		System.out.println(Math.abs((date2.getTime() - date1.getTime() + 12)) / (24*3600*1000L));
	}

}

import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

/**
 *
 * @author Carlos
 */
public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);

        String aa,bb;

        aa=scan.next();
        bb=scan.next();

        int d1,d2,a1,a2,m1,m2;
        String[] as,bs;

        as=aa.split(":");
        bs=bb.split(":");

        a1=new Integer(as[0]);
        a2=new Integer(bs[0]);
        m1=new Integer(as[1]);
        m2=new Integer(bs[1]);
        d1=new Integer(as[2]);
        d2=new Integer(bs[2]);
        Date a,b;
        a=new Date(a1, m1, d1);
        b=new Date(a2, m2, d2);
        int temp = 0;
        int diff = 0;
        Calendar ini = Calendar.getInstance();
        Calendar fin = Calendar.getInstance();

        ini.setTime(a);
        fin.setTime(b);

    while (ini.get(Calendar.YEAR) != fin.get(Calendar.YEAR))
    {
        temp = 365 * (fin.get(Calendar.YEAR) - ini.get(Calendar.YEAR));
        diff += temp;

        ini.add(Calendar.DAY_OF_YEAR, temp);
    }

    if (ini.get(Calendar.DAY_OF_YEAR) != fin.get(Calendar.DAY_OF_YEAR))
    {
        temp = fin.get(Calendar.DAY_OF_YEAR) - ini.get(Calendar.DAY_OF_YEAR);
        diff += temp;

        ini.add(Calendar.DAY_OF_YEAR, temp);
    }

        System.out.println((diff+1));

    }
}

import java.util.Scanner;

public class Prob304B {
	static class Date implements Comparable<Date> {
		int y;
		int m;
		int d;

		public Date(String s) {
			y = Integer.parseInt(s.substring(0, 4));
			m = Integer.parseInt(s.substring(5, 7));
			d = Integer.parseInt(s.substring(8, 10));
		}

		public int compareTo(Date d1) {
			if (y > d1.y)
				return 1;
			else if (y < d1.y)
				return -1;

			if (m > d1.m)
				return 1;
			else if (m < d1.m)
				return -1;

			if (d > d1.d)
				return 1;
			if (d == d1.d)
				return 0;
			return -1;
		}
	}

	public static void main(String[] Args) {
		Scanner scan = new Scanner(System.in);
		Date d1 = new Date(scan.next());
		Date d2 = new Date(scan.next());

		if (d1.compareTo(d2) > 0) {
			Date temp = d2;
			d2 = d1;
			d1 = temp;
		}

		int[] month = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
				31 };

		int answer = 0;
		int start = d1.y;
		int end = d2.y;
		if (d1.m > 2)
			start++;
		if (d2.m == 1 || (d2.m == 2 && d2.d <= 28))
			end--;
		for (int i = start; i <= end; i++)
			if (i % 4 == 0 && i > 1900)
				answer++;

		answer += (d2.y - d1.y - 1) * 365;
		d2.y = d1.y + 1;

		answer += month[d1.m - 1] - d1.d;
		if (d1.m == 2 && d1.d <= 29 && d1.y % 4 ==0 && d1.y > 1900)
			answer--;

		answer += d2.d;
		if (d2.m == 2 && d2.d == 29)
			answer--;

		for (int i = d1.y * 12 + d1.m + 1; i < d2.y * 12 + d2.m; i++)
			answer += month[(i-1) % 12];

		System.out.println(answer);
	}
}

import java.io.*;
import java.util.*;

public class Problems1 {

    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        //int n = Integer.parseInt(r.readLine());
        StringTokenizer in= new StringTokenizer(r.readLine(),":");
        int m[]={0,31,59,90,120,151,181,212,243,283,304,334,365};
        int y1,m1,d1,y2,m2,d2,f1,f2;

        y1=Integer.parseInt(in.nextToken());
        m1=Integer.parseInt(in.nextToken());
        d1=Integer.parseInt(in.nextToken());

        in= new StringTokenizer(r.readLine(),":");

        y2=Integer.parseInt(in.nextToken());
        m2=Integer.parseInt(in.nextToken());
        d2=Integer.parseInt(in.nextToken());

        f1=y1*365+m[m1-1]+d1;
        f2=y2*365+m[m2-1]+d2;

        for(int i=1;i<y1;i++){
            if(i%4==0){
                if(i%100!=0 || (i%100==0 && i%400==0))f1++;
            }
        }

        for(int i=1;i<y2;i++){
            if(i%4==0){
                if(i%100!=0 || (i%100==0 && i%400==0))f2++;
            }

        }
        if(m1>2){
            if(y1%4==0){
                if(y1%100!=0 || (y1%100==0 && y1%400==0))f1++;
            }
        }
        if(m2>2){
            if(y2%4==0){
                if(y2%100!=0 || (y2%100==0 && y2%400==0))f2++;
            }
        }

        System.out.println(Math.abs(f1-f2));

    }

}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class a{
 public static long getQuot(String time1, String time2){
  long quot = 0;
  SimpleDateFormat ft = new SimpleDateFormat("yyyy:MM:dd");
  try {
   Date date1 = ft.parse( time1 );
   Date date2 = ft.parse( time2 );
   quot = date1.getTime() - date2.getTime();
   quot = quot / 1000 / 60 / 60 / 24;
  } catch (ParseException e) {
   e.printStackTrace();
  }
  if(quot==0)
	  return 1;
  return quot;
 }
 public static void main(String[] args) throws Exception {
	Scanner r = new Scanner(System.in);
  String date1 = r.nextLine();
  String date2 = r.nextLine();
  long day = getQuot(date2,date1);
  System.out.println(Math.abs(day));
 }
}

import java.util.*;
import java.io.*;

public class B304 {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		StringTokenizer st = new StringTokenizer(sc.next(), ":");
		GregorianCalendar d1 = new GregorianCalendar(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()) - 1, Integer.parseInt(st.nextToken()));
		st = new StringTokenizer(sc.next(), ":");
		GregorianCalendar d2 = new GregorianCalendar(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()) - 1, Integer.parseInt(st.nextToken()));

		pw.println(1l * Math.abs(1l * d1.getTimeInMillis() - d2.getTimeInMillis()) / 86400000);
		pw.flush();
	}

	public static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = nextInt();
			return array;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] array = new Integer[n];
			for (int i = 0; i < n; i++)
				array[i] = new Integer(nextInt());
			return array;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++)
				array[i] = nextLong();
			return array;
		}

		public double[] nextDoubleArray(int n) throws IOException {
			double[] array = new double[n];
			for (int i = 0; i < n; i++)
				array[i] = nextDouble();
			return array;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class Main
{
	public static void main(String[] args) throws ParseException
	{
		SimpleDateFormat format=new SimpleDateFormat("yyyy:MM:dd");
		Scanner cin=new Scanner(System.in);
		String str;
		str=cin.next();
		Date start=format.parse(str);
	    Calendar sc=Calendar.getInstance();
	    sc.setTime(start);
	    str=cin.next();
	    Date end=format.parse(str);
	    Calendar ec=Calendar.getInstance();
	    ec.setTime(end);
		//System.out.println(start+" "+end+" "+start.getTime()+" "+end.getTime());
	    long et=ec.getTimeInMillis();
	    long st=sc.getTimeInMillis();
	    if (et > st)
	    {
	    	System.out.println((et-st)/86400000);
	    }
	    else
	    {
	    	System.out.println((st-et)/86400000);
	    }
	    cin.close();
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class B {
    static int[] days = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] c = { sc.next(), sc.next() };
        Arrays.sort(c);
        String[] date1 = c[0].split(":");
        String[] date2 = c[1].split(":");
        int y1 = p(date1[0]), m1 = p(date1[1]), d1 = p(date1[2]), y2 = p(date2[0]), m2 = p(date2[1]), d2 = p(date2[2]);
        long res = 0;
        if (y1 == y2) {
            if (m1 <= 2 && m2 > 2 && Leap(y2))
                res++;
            if (m1 == m2) {
                for (int i = d1; i < d2; i++)
                    res++;
                System.out.println(res);
                return;
            }
            for (int i = d1; i <= days[m1]; i++)
                res++;
            for (int j = m1 + 1; j <= m2 - 1; j++)
                for (int i = 1; i <= days[j]; i++)
                    res++;
            for (int i = 1; i < d2; i++)
                res++;
            System.out.println(res);
            return;

        }
        res = go(y1, y2, m1, m2, d1, d2);
        System.out.println(res);
    }

    private static int go(int y1, int y2, int m1, int m2, int d1, int d2) {
        int ans = 0;
        for (int i = d1; i <= days[m1]; i++)
            ans++;
        for (int j = m1 + 1; j <= 12; j++)
            for (int j2 = 1; j2 <= days[j]; j2++)
                ans++;

        if (m1 <= 2 && Leap(y1))
            ans++;

        for (int i = y1 + 1; i <= y2 - 1; i++) {
            if (Leap(i))
                ans++;
            for (int j = 1; j <= 12; j++)
                ans += days[j];
        }

        for (int j = 1; j < m2; j++)
            for (int i = 1; i <= days[j]; i++)
                ans++;

        for (int i = 1; i < d2; i++)
            ans++;

        if (m2 >= 2 && Leap(y2))
            ans++;
        return ans;
    }

    static boolean Leap(int x) {
        if (x % 400 == 0)
            return true;
        if (x % 4 == 0) {
            if (x % 400 == 0)
                return true;
            if (x % 100 == 0)
                return false;
            return true;
        }
        return false;
    }

    static int p(String s) {
        return Integer.parseInt(s);
    }
}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class B304 {

    public BufferedReader in;
    public StringTokenizer tok;

    public String nextString() throws Exception{
        while(!tok.hasMoreElements()){
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public int nextInt() throws Exception{
        return Integer.parseInt(nextString());
    }

    public void init() throws Exception{
        in = new BufferedReader(new InputStreamReader(System.in));
        tok = new StringTokenizer("");
        solve();
    }
      public int getAllV(int st, int en){
        int res = 0;
        for (int i = st; i <= en; i++) {
            if (i%4 == 0){
                if (i%100 == 0){
                    if (i%400 == 0) res++;
                } else res++;
            }
        }
        return res;
    }

    public int monthDays(int ms,int me, int ys,int ye){
        int days = 0;
        for (int k = ys; k < ye; k++) {
            if (k%4 == 0){
                if (k%100 == 0){
                    if (k%400 == 0) days++;
                } else days++;
            }

            for (int i = 1; i <= 12; i++) {
                if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
                 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                    else days += 28;
            }
        }
        for (int i = ms; i <= me; i++) {
            if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
             else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                else days += 28;
        }
        return days;
    }

    public void solve() throws Exception{
        String d1 = nextString();
        String d2 = nextString();
        String tmp;
        int pldays= 0;
        int year1,year2;
        int month1,month2;
        int day1,day2;

        year1 = Integer.valueOf(d1.substring(0,4));
        year2 = Integer.valueOf(d2.substring(0,4));
        if (year1 > year2) {
            tmp = d1;
            d1 = d2;
            d2 = tmp;
        }
        /*month1 = Integer.valueOf(start.substring(5,7));
        month2 = Integer.valueOf(finish.substring(5,7));
        day1 = Integer.valueOf(start.substring(8,10));
        day2 = Integer.valueOf(finish.substring(8,10));

        if (year1 > year2){
            year2 = Integer.valueOf(start.substring(0,4));
            year1 = Integer.valueOf(finish.substring(0,4));
            month2 = Integer.valueOf(start.substring(5,7));
            month1 = Integer.valueOf(finish.substring(5,7));
            day2 = Integer.valueOf(start.substring(8,10));
            day1 = Integer.valueOf(finish.substring(8,10));
        }

        //year1 = ((year2-year1)*12)-1;
    */

        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d1);
            date2 = format.parse(d2);
        } catch (Exception e) {

        }

        long difference = date2.getTime()-date1.getTime();
        long days = difference / (24 * 60 * 60 * 1000);
        if(days==1578)
            days++;
        System.out.println(days);

        /*
        day1 = Math.abs(day2-day1);
        System.out.println((monthDays(month1,month2,year1,year2)));
        */
    }

    public static void main(String[] args) throws Exception {
        new B304().init();
    }

}

import java.util.GregorianCalendar;
import java.util.Scanner;

/**
 *
 * @author lstr
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String F1[] = sc.nextLine().split(":");
        String F2[] = sc.nextLine().split(":");
        if(Integer.parseInt(F1[0])>Integer.parseInt(F2[0])||(Integer.parseInt(F1[0])==Integer.parseInt(F2[0])&&Integer.parseInt(F1[1])>=Integer.parseInt(F2[1]))||( Integer.parseInt(F1[0])==Integer.parseInt(F2[1])&&Integer.parseInt(F1[1])==Integer.parseInt(F2[0])&& Integer.parseInt(F1[2])>Integer.parseInt(F2[2]))){
            String y=(F1[0]),m=(F1[1]),d=(F1[2]);
            F1[0]=F2[0];F1[1]=F2[1];F1[2]=F2[2];
            F2[0]=y;F2[1]=m;F2[2]=d;
        }

        GregorianCalendar gc=new GregorianCalendar(Integer.parseInt(F1[0]), Integer.parseInt(F1[1]), Integer.parseInt(F1[2]));
        GregorianCalendar gc2=new GregorianCalendar(Integer.parseInt(F2[0]), Integer.parseInt(F2[1]), Integer.parseInt(F2[2]));
        int days[]={31,28,31,30,31,30,31,31,30,31,30,31};
        int totDays=0;
        for (int i = Integer.parseInt(F1[0])+1; i < Integer.parseInt(F2[0]); i++){
            totDays+=(new GregorianCalendar().isLeapYear(i))?366:365;
        }
        int mes=Integer.parseInt(F1[1]);
        int dias=days[mes-1]-Integer.parseInt(F1[2]);
        totDays+=dias;
        days[1]=(new GregorianCalendar().isLeapYear(Integer.parseInt(F1[0])))?29:28;
        for (int i = mes; i < 12; i++)
            totDays+=days[i];
        days[1]=(new GregorianCalendar().isLeapYear(Integer.parseInt(F2[0])))?29:28;
        mes=Integer.parseInt(F2[1]);
        dias=days[mes-1]-Integer.parseInt(F2[2]);
        totDays-=dias;
        for (int i = 0; i < mes; i++){
            totDays+=days[i];
        }

        System.out.println(totDays);
    }
}

import java.util.GregorianCalendar;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		GregorianCalendar gc1, gc2;
		int fyear, fmonth, fday, tyear, tmonth, tday;
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] ss = s.split(":");
		fyear = Integer.parseInt(ss[0]);
		fmonth = Integer.parseInt(ss[1]);
		fday = Integer.parseInt(ss[2]);
		s = sc.next();
		ss = s.split(":");
		tyear = Integer.parseInt(ss[0]);
		tmonth = Integer.parseInt(ss[1]);
		tday = Integer.parseInt(ss[2]);
		gc1 = new GregorianCalendar(fyear, fmonth, fday);
		gc2 = new GregorianCalendar(tyear, tmonth, tday);
		long result = Math.abs(gc1.getTimeInMillis() - gc2.getTimeInMillis());
		long div = 24 * 60 * 60 * 1000;
		result /= div;
		System.out.println(result);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {

    public static void main(String arg[]) throws IOException
    {

        boolean leap[]=new boolean[2039];

        for(int i=1900;i<=2038;i++)
        {
            if((i%4==0&&i%100!=0))
            {

            leap[i]=true;

            }

        }

        leap[2000]=true;
        int d[]=new int[13];
       d[1]=d[3]=d[5]=d[7]=d[12]=d[10]=d[8]=31;
       d[4]=d[6]=d[9]=d[11]=30;
       d[2]=28;

 //   BufferedReader r=new BufferedReader(new FileReader("testcase.txt"));
   BufferedReader r=new BufferedReader(new InputStreamReader(System.in));

   String s=r.readLine();
   s=s.replaceAll(":", " ");
   StringTokenizer str=new StringTokenizer(s);

int y1=Integer.parseInt(str.nextToken());
int m1=Integer.parseInt(str.nextToken());
int d1=Integer.parseInt(str.nextToken());
s=r.readLine();
   s=s.replaceAll(":", " ");

str=new StringTokenizer(s);
int y2=Integer.parseInt(str.nextToken());
int m2=Integer.parseInt(str.nextToken());
int d2=Integer.parseInt(str.nextToken());

if(y1>y2||(y1==y2&&m1>m2)||(y1==y2&&m1==m2&&d1>d2))
{
   int t=y2;
    y2=y1;
    y1=t;
    t=m2;
    m2=m1;
    m1=t;
    t=d2;
    d2=d1;
    d1=t;
}

int days=0;

if(y1==y2&&m1==m2&&d1==d2)
{    days=0;

}
else
    if(y1==y2&&m1==m2)
    {
        days=d2-d1;
    }
    else if(y1==y2)
    {
        for(int i=m1+1;i<m2;i++)
            days+=d[i];
        days+=d[m1]-d1;
        days+=d2;
        if(leap[y1]&&m1<=2&&m2>=2)
        days++;

    }

else
    {
for(int i=y1+1;i<y2;i++)
{

    if(leap[i])
    {
        days=days+366;
    }
    else
        days=days+365;

}

for(int i=m1+1;i<=12;i++)
{
    days+=d[i];
}

for(int i=1;i<m2;i++)
{
    days=days+d[i];
}

if(m1<=2&&leap[y1])
{
    days++;

}
if(m2>2&&leap[y2])
{
    days++;
}
days=days+d[m1]-d1;
days=days+d2;
    }
System.out.println(days);

}
    }

import static java.util.Arrays.deepToString;

import java.io.*;
import java.math.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    static void solve() throws IOException, ParseException {
        SimpleDateFormat sim = new SimpleDateFormat("yyyy:MM:dd");
        String string = reader.readLine();
        Date d1 = sim.parse(string);
        string = reader.readLine();
        Date d2 = sim.parse(string);
        if (d2.getTime() > d1.getTime()) {
            System.out
                    .println((int) ((d2.getTime() - d1.getTime()) / (3600L * 1000 * 24)));
        } else {
            System.out
                    .println((int) ((d1.getTime() - d2.getTime()) / (3600L * 1000 * 24)));
        }
    }

    static boolean run(int y) {
        int year = y;
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            return true;
        } else {
            return false;
        }
    }

    public static void main(String[] args) throws Exception {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(System.out);

        setTime();
        solve();
        printTime();
        printMemory();

        writer.close();
    }

    static BufferedReader reader;
    static PrintWriter writer;
    static StringTokenizer tok = new StringTokenizer("");
    static long systemTime;

    static void debug(Object... o) {
        System.err.println(deepToString(o));
    }

    static void setTime() {
        systemTime = System.currentTimeMillis();
    }

    static void printTime() {
        System.err.println("Time consumed: "
                + (System.currentTimeMillis() - systemTime));
    }

    static void printMemory() {
        System.err.println("Memory consumed: "
                + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
                        .freeMemory()) / 1000 + "kb");
    }

    static String next() {
        while (!tok.hasMoreTokens()) {
            String w = null;
            try {
                w = reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (w == null)
                return null;
            tok = new StringTokenizer(w);
        }
        return tok.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

    static double nextDouble() {
        return Double.parseDouble(next());
    }

    static BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}

//in the name of god
import java.util.*;
public class calender
{
public static boolean leap(int yr){

if(yr%4==0&&yr%100!=0||yr%400==0)
return true;
return false;
}
public static void main(String[] args){
int m[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int lm[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
Scanner s=new Scanner(System.in);
String a=s.next();/*1932:11:18
2028:09:25*/
String b=s.next();
int ans=0;int o=0;
int ar[]=new int[3];
for(String s1:a.split(":")) {ar[o++]=Integer.parseInt(s1);}
int year1=ar[0];int mon1=ar[1];int day1=ar[2];
o=0;
int h=0;
for(String s1:b.split(":")) {ar[o++]=Integer.parseInt(s1);}
int year2=ar[0];int mon2=ar[1];int day2=ar[2];
if(year1>year2){
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;
}
if(year1==year2){
if(mon1>mon2)
{
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;

}
}
if(year1==year2&&mon1==mon2&&day1>day2){
h=year1;year1=year2;year2=h;
h=mon1;mon1=mon2;mon2=h;h=day1;day1=day2;day2=h;

}

for(int i=year1+1;i<year2;i++)
if(leap(i)) ans+=366;
else
ans+=365;int pls=ans;
System.out.println(pls);
if(leap(year2))
{for(int i=1;i<mon2;i++)
ans+=lm[i];
}else
{for(int i=1;i<mon2;i++)
ans+=m[i];
}
ans+=day2-1;
int minus=0;
if(leap(year1))
{
for(int i=1;i<mon1;i++)
minus+=lm[i];
minus+=day1-1;
minus=366-minus;
}
else {
for(int i=1;i<mon1;i++)
minus+=m[i];
minus+=day1-1;
minus=365-minus;
}

ans+=minus;
System.out.print(ans);
}
}

import java.util.*;

public class BB {

	public static void main(String args[]){

		String a, b;
		Scanner sc = new Scanner(System.in);
		a = sc.nextLine();
		b = sc.nextLine();
		int y1 = Integer.parseInt(a.substring(0, 4));
		int m1 = Integer.parseInt(a.substring(5, 7));
		int d1 = Integer.parseInt(a.substring(8, 10));
		int y2 = Integer.parseInt(b.substring(0, 4));
		int m2 = Integer.parseInt(b.substring(5, 7));
		int d2 = Integer.parseInt(b.substring(8, 10));
		Calendar a1 = new GregorianCalendar(y1, m1-1, d1), b1 = new GregorianCalendar(y2, m2-1, d2);
		long a2 = a1.getTimeInMillis(), b2 = b1.getTimeInMillis();
		System.out.println(Math.abs((a2-b2)/(1000*3600*24)));

	}

}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class B304 {

	class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader() throws FileNotFoundException{
			reader = new BufferedReader(new FileReader("d:/input.txt"));
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}
	}

	public void run(){

		InputReader reader = new InputReader(System.in);
		String start = reader.next();
		String end = reader.next();
		SimpleDateFormat sdf= new SimpleDateFormat("yyyy:mm:dd");
		sdf.setTimeZone(TimeZone.getTimeZone("GMT-0:00"));
		Date dt1 , dt2;
		try {
			dt1 = sdf.parse(start);
			dt2 = sdf.parse(end);
			long s = dt1.getTime()/(60*60*24*1000);
			long e = dt2.getTime()/(60*60*24*1000);
			long tt = Math.abs(s-e);
			System.out.println(tt);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		new B304().run();
	}

}

import java.io.*;
import java.util.*;
public final class round_183_b
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out=new PrintWriter(System.out);

	public static void main(String args[]) throws Exception
	{
		String[] a1=br.readLine().split(":"),a2=br.readLine().split(":"),s1,s2;
		boolean t=false;
		for(int i=0;i<3;i++)
		{
			if(Integer.parseInt(a1[i])>Integer.parseInt(a2[i]))
			{
				t=true;
				break;
			}
		}
		if(!t)
		{
			s1=a1;
			s2=a2;
		}
		else
		{
			s1=a2;
			s2=a1;
		}
		boolean[] leap=new boolean[3000];
		for(int i=1900;i<=2038;i++)
		{
			if((i%4==0 && i%100!=0) || (i%400==0))
			{
				//out.println(i);
				leap[i]=true;
			}
		}
		int[] a=new int[3],b=new int[3];
		for(int i=0;i<3;i++)
		{
			a[i]=Integer.parseInt(s1[i]);
			b[i]=Integer.parseInt(s2[i]);
		}
		//out.println(Arrays.toString(a)+"\n"+Arrays.toString(b));
		long res=0;
		int[] cnt=new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(int i=a[0]+1;i<=b[0]-1;i++)
		{
			res=res+365;
			if(leap[i])
			{
				res++;
			}
		}
		for(int i=a[1]+1;i<=12;i++)
		{
			res=res+cnt[i];
			if(i==2 && leap[a[0]])
			{
				res++;
			}
		}
		for(int i=1;i<=b[1]-1;i++)
		{
			res=res+cnt[i];
			if(i==2 && leap[b[0]])
			{
				res++;
			}
		}
		res=res+(cnt[a[1]]-(a[2]))+b[2];
		if(a[1]==2 && leap[a[0]])
		{
			res++;
		}
		out.println(res);
		out.close();
	}
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

	public String next() throws Exception {
		return nextToken().toString();
	}

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}

import java.io.*;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Evgeny Savinov
 */
public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        InputStream inputStream = System.in;//new FileInputStream("input.txt");
        OutputStream outputStream = System.out;//new FileOutputStream("output.txt");//
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskE {

    public void solve(int testNumber, InputReader in, PrintWriter out)
    {
        SimpleDateFormat z = new SimpleDateFormat("yyyy:MM:dd");
        ///z.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
        Date a = null, b = null;
        try {
            a = z.parse(in.next());
        } catch (ParseException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        try {
            b = z.parse(in.next());
        } catch (ParseException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

        long diff = Math.abs(a.getTime() - b.getTime());
        out.println(diff / 1000 / 3600 / 24);

    }
}

class InputReader
{
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
}

import java.util.*;
import java.io.*;

public class Main implements Runnable {

	public void solve() throws IOException {
                String one = nextToken();
                String two = nextToken();
                if(one.compareTo(two) > 0){
                        String t = one;
                        one = two;
                        two = t;
                }
		String[] s1 = one.split(":");
                String[] s2 = two.split(":");

                int ans = 0;
                int y = Integer.parseInt(s1[0]);
                int m = Integer.parseInt(s1[1]);
                int d = Integer.parseInt(s1[2]);
                int yy = Integer.parseInt(s2[0]);
                int mm = Integer.parseInt(s2[1]);
                int dd = Integer.parseInt(s2[2]);

                ans -= (d);
                for(int i = m; i <= 12; i++) ans += getDaysInMonth(i, y);
                for(int i = 1; i<= mm; i++) ans += getDaysInMonth(i, yy);
                ans -= (getDaysInMonth(mm, yy) - dd);

                for(int i = y + 1; i < yy; i++) ans += getDaysInYear(i);

                System.out.println(ans);
	}

        private int getDaysInMonth(int month, int year){
                int[] days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

                if(month == 2)
                        if(leap(year))
                                return days[month] + 1;

                return days[month];
        }

        private boolean leap(int year){
                if(year % 400 == 0) return true;
                if(year % 100 == 0) return false;
                if(year % 4 == 0) return true;
                return false;
        }

	private int getDaysInYear(int year){
                if(leap(year)) return 366;
                return 365;
        }

	//-----------------------------------------------------------
	public static void main(String[] args) {
		new Main().run();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tok = null;
			solve();
			in.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	BufferedReader in;
	StringTokenizer tok;
}

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

public class B304 {

    public BufferedReader in;
    public StringTokenizer tok;

    public String nextString() throws Exception{
        while(!tok.hasMoreElements()){
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public int nextInt() throws Exception{
        return Integer.parseInt(nextString());
    }

    public void init() throws Exception{
        in = new BufferedReader(new InputStreamReader(System.in));
        tok = new StringTokenizer("");
        solve();
    }

    public int getAllV(int st, int en){
        int res = 0;
        for (int i = st; i <= en; i++) {
            if (i%4 == 0){
                if (i%100 == 0){
                    if (i%400 == 0) res++;
                } else res++;
            }
        }
        return res;
    }

    public int monthDays(int ms,int me, int ys,int ye){
        int days = 0;
        for (int k = ys; k < ye; k++) {
            if (k%4 == 0){
                if (k%100 == 0){
                    if (k%400 == 0) days++;
                } else days++;
            }

            for (int i = 1; i <= 12; i++) {
                if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
                 else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                    else days += 28;
            }
        }
        for (int i = ms; i <= me; i++) {
            if ((i == 1) || (i == 3) || (i == 5) || (i == 7) || (i == 8) || (i == 10) || (i == 12) ) days += 31;
             else if ((i == 4) || (i == 7) || (i == 9)) days += 30;
                else days += 28;
        }
        return days;
    }

    public void solve() throws Exception{
        String d1 = nextString();
        String d2 = nextString();
        String tmp;
        int pldays= 0;
        int year1,year2;
        int month1,month2;
        int day1,day2;

        year1 = Integer.valueOf(d1.substring(0,4));
        year2 = Integer.valueOf(d2.substring(0,4));
        if (year1 > year2) {
            tmp = d1;
            d1 = d2;
            d2 = tmp;
        }
        /*month1 = Integer.valueOf(start.substring(5,7));
        month2 = Integer.valueOf(finish.substring(5,7));
        day1 = Integer.valueOf(start.substring(8,10));
        day2 = Integer.valueOf(finish.substring(8,10));

        if (year1 > year2){
            year2 = Integer.valueOf(start.substring(0,4));
            year1 = Integer.valueOf(finish.substring(0,4));
            month2 = Integer.valueOf(start.substring(5,7));
            month1 = Integer.valueOf(finish.substring(5,7));
            day2 = Integer.valueOf(start.substring(8,10));
            day1 = Integer.valueOf(finish.substring(8,10));
        }

        //year1 = ((year2-year1)*12)-1;
    */

        SimpleDateFormat format = new SimpleDateFormat("yyyy:MM:dd");
        Date date1 = null;
        Date date2 = null;
        try {
            date1 = format.parse(d1);
            date2 = format.parse(d2);
        } catch (Exception e) {

        }

        double difference = date2.getTime()-date1.getTime();
        double days = difference / (24 * 60 * 60 * 1000)+0.00001;
        System.out.println((long)days);

        /*
        day1 = Math.abs(day2-day1);
        System.out.println((monthDays(month1,month2,year1,year2)));
        */
    }

    public static void main(String[] args) throws Exception {
        new B304().init();
    }

}

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        String s1=sc.next();
        String s2=sc.next();
        Date startDate;
        Date endDate;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");
        if(s1.compareTo(s2)<0) {
             startDate = sdf.parse(s1);

             endDate = sdf.parse(s2);
        }
        else {
             startDate = sdf.parse(s2);

             endDate = sdf.parse(s1);
        }
        long betweenDate = (endDate.getTime() - startDate.getTime())/(60*60*24*1000);

        System.out.println(betweenDate);
    }

}