Calendars in widespread use today include the Gregorian calendar, which is the de facto international standard, and is used almost everywhere in the world for civil purposes. The Gregorian reform modified the Julian calendar's scheme of leap years as follows: Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100; the centurial years that are exactly divisible by 400 are still leap years. For example, the year 1900 is not a leap year; the year 2000 is a leap year.   In this problem, you have been given two dates and your task is to calculate how many days are between them. Note, that leap years have unusual number of days in February.Look at the sample to understand what borders are included in the aswer.

The first two lines contain two dates, each date is in the format yyyy:mm:dd (1900 ≤ yyyy ≤ 2038 and yyyy:mm:dd is a legal date).

Print a single integer — the answer to the problem.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new System.IO.StreamReader(@"..\..\..\in"));
            Console.SetOut(new System.IO.StreamWriter(@"..\..\..\out"));
            for (int testN = 0; testN < 2; testN++)
            {
#endif
                //SetCulture();
                var s1 = Console.ReadLine();
                var s2 = Console.ReadLine();
                var d1 = DateTime.ParseExact(s1, "yyyy:MM:dd", CultureInfo.InvariantCulture);
                var d2 = DateTime.ParseExact(s2, "yyyy:MM:dd", CultureInfo.InvariantCulture);

                int res = Math.Abs((int)((d2 - d1).TotalDays));

                Console.WriteLine(res);
                //Console.WriteLine(string.Format(NumberFormatInfo.InvariantInfo, "{0:F4}", res));
#if !ONLINE_JUDGE
                Console.ReadLine();
            }
            Console.In.Close();
            Console.Out.Close();
#endif
        }

        private static char[] _defaultSplitter = new char[] { ' ', '\t' };

        private static void SetCulture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }

        private static char[] ReadChars(int n)
        {
            char[] buffer = new char[n];
            Console.In.ReadBlock(buffer, 0, n);
            return buffer;
        }

        private static string[] ReadAll()
        {
            return Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords()
        {
            return ReadWords(_defaultSplitter);
        }

        private static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        private static int[] ReadInts(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        private static int[] ReadInts()
        {
            return ReadInts(_defaultSplitter);
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static double ReadDouble()
        {
            return double.Parse(Console.ReadLine(), NumberFormatInfo.InvariantInfo);
        }

        private static int _pos = 0;
        private static string[] _inputLine = new string[0];

        private static void CheckInputLine()
        {
            if (_pos >= _inputLine.Length)
            {
                _inputLine = ReadWords();
                _pos = 0;
            }
        }

        private static string NextWord()
        {
            CheckInputLine();
            return _inputLine[_pos++];
        }

        private static int NextInt()
        {
            CheckInputLine();
            return int.Parse(_inputLine[_pos++]);
        }

        private static long NextLong()
        {
            CheckInputLine();
            return long.Parse(_inputLine[_pos++]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dates
{
    class Program
    {
        static void Main(string[] args)
        {
            string firstDateString = Console.ReadLine();
            string[] firstDateStuff = firstDateString.Split(':');
            int year = Int32.Parse(firstDateStuff[0]);
            int month = Int32.Parse(firstDateStuff[1]);
            int day = Int32.Parse(firstDateStuff[2]);
            DateTime firstDate = new DateTime(year, month, day);
            string secondDateString = Console.ReadLine();
            string[] secondDateStuff = secondDateString.Split(':');
            year = Int32.Parse(secondDateStuff[0]);
            month = Int32.Parse(secondDateStuff[1]);
            day = Int32.Parse(secondDateStuff[2]);
            DateTime secondDate = new DateTime(year, month, day);
            int dayDifference = (int) (firstDate - secondDate).TotalDays;
            Console.WriteLine(Math.Abs(dayDifference));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CF183A
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            var a1 = s1.Split(':');
            var a2 = s2.Split(':');
            DateTime dt1 = new DateTime(int.Parse(a1[0]),int.Parse(a1[1]),int.Parse(a1[2]));
            DateTime dt2 = new DateTime(int.Parse(a2[0]), int.Parse(a2[1]), int.Parse(a2[2]));
            var days = (dt2 - dt1).Days;
            if (days < 0)
                days = -days;
            Console.WriteLine(days);
        }

    }
}

using System.IO;
using System;
using System.Globalization;

class Program
{
    static void Main()
    {
        string s1 = Console.ReadLine();
        string s2 = Console.ReadLine();

        var d1 = DateTime.ParseExact(s1, "yyyy:MM:dd", CultureInfo.InvariantCulture);
        var d2 = DateTime.ParseExact(s2, "yyyy:MM:dd", CultureInfo.InvariantCulture);

        var a1 = d1 < d2 ? d1 : d2;
        var a2 = d1 > d2 ? d1 : d2;

        var t1 = a2 - a1;
        Console.WriteLine(t1.TotalDays);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static int i(string s)
        {
            return Convert.ToInt32(s);
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(':');
            DateTime d1 = new DateTime(i(s[0]), i(s[1]), i(s[2]));
            s = Console.ReadLine().Split(':');
            DateTime d2 = new DateTime(i(s[0]), i(s[1]), i(s[2]));
            if(d2 < d1){
                DateTime temp = d2;
                d2 = d1;
                d1 = temp;
            }
            TimeSpan t = d2 - d1;
            Console.WriteLine(t.Days);
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Calendar
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            DateTime t1, t2;
            string s = reader.ReadLine();

            t1 = new DateTime(int.Parse(s.Substring(0, 4)), int.Parse(s.Substring(5, 2)), int.Parse(s.Substring(8, 2)));
            s = reader.ReadLine();
            t2 = new DateTime(int.Parse(s.Substring(0, 4)), int.Parse(s.Substring(5, 2)), int.Parse(s.Substring(8, 2)));

            writer.WriteLine(Math.Abs((int) ((t2 - t1).TotalDays)));
            writer.Flush();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace codeforces____calendar
{
    class Program
    {
        static void Main(string[] args)
        {
            string input;
            input = Console.ReadLine();
            String[] s = input.Split(':');
            int year = int.Parse(s[0]);
            int month = int.Parse(s[1]);
            int day = int.Parse(s[2]);
            DateTime start = new DateTime(year, month, day);
            input = Console.ReadLine();
            s = new String[3];
            s = input.Split(':');
            year = int.Parse(s[0]);
            month = int.Parse(s[1]);
            day = int.Parse(s[2]);
            DateTime enddate = new DateTime(year, month, day);
            TimeSpan result = enddate.Subtract(start);
            Console.WriteLine(Math.Abs(result.Days));
        }
    }
}

using System;

namespace CF.B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] d1 = Console.ReadLine().Split(new char[] { ':' });
            string[] d2 = Console.ReadLine().Split(new char[] { ':' });
            DateTime dt1 = new DateTime(Convert.ToInt32(d1[0]), Convert.ToInt32(d1[1]), Convert.ToInt32(d1[2]));
            DateTime dt2 = new DateTime(Convert.ToInt32(d2[0]), Convert.ToInt32(d2[1]), Convert.ToInt32(d2[2]));
            TimeSpan ts = dt2 - dt1;
            Console.WriteLine(Math.Abs(ts.Days));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
using System.Threading;
using System.Globalization;

namespace Timus
{
    class Program
    {
        static void Solve()
        {
            DateTime st = DateTime.ParseExact(ReadString(), "yyyy:MM:dd", CultureInfo.InvariantCulture),
                     en = DateTime.ParseExact(ReadString(), "yyyy:MM:dd", CultureInfo.InvariantCulture);
            TimeSpan offset = en - st;
            WriteLine(Math.Abs(offset.TotalDays));
        }

        public static void Main(string[] args)
        {
            //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if !ONLINE_JUDGE
            In = new StreamReader(new FileStream("input.txt", FileMode.Open));
            //Cons.Out = new StreamWriter(new FileStream("output.txt", FileMode.Create));
#endif
            Solve();

#if !ONLINE_JUDGE
            Console.Write("\nAny key == exit\n");
            Console.ReadLine();
#endif

            In.Close();
            Out.Close();
        }
        #region Read&Write

        static TextReader In = System.Console.In;
        static TextWriter Out = System.Console.Out;

        static string ReadToaken()
        {
            string result = "";
            for (char temp = ReadChar(); result == "" || temp != '\0'; temp = ReadChar())
            {
                if (temp != '\0')
                {
                    result += temp;
                }
            }
            return result;
        }

        private static char ReadChar()
        {
            char temp = (char)In.Read();
            if (temp == ' ' || temp == '\n' || temp == 65535 || temp == '\r') //если равен пробелу, переносу строки либо концу потока
                return '\0';
            return temp;
        }

        //read
        static int ReadInt()
        {
            return int.Parse(ReadString());
        }
        static short ReadShort()
        {
            return short.Parse(ReadToaken());
        }
        static ulong ReadUlong()
        {
            return ulong.Parse(ReadToaken());
        }
        static long ReadLong()
        {
            return long.Parse(ReadToaken());
        }
        static double ReadDouble()
        {
            return double.Parse(ReadToaken());
        }

        static string ReadString()
        {
            return ReadToaken();
        }

        static int[] ReadIntArray(int startIndex, int count)
        {
            int[] arr = new int[startIndex + count];
            for (int i = startIndex; i < startIndex + count; i++)
            {
                arr[i] = int.Parse(ReadToaken());
            }
            return arr;
        }
        static ulong[] ReadUlongArray(int startIndex, int count)
        {
            ulong[] arr = new ulong[startIndex + count];
            for (int i = startIndex; i < startIndex + count; i++)
            {
                arr[i] = ulong.Parse(ReadToaken());
            }
            return arr;
        }
        static long[] ReadLongArray(int startIndex, int count)
        {
            long[] arr = new long[startIndex + count];
            for (int i = startIndex; i < startIndex + count; i++)
            {
                arr[i] = long.Parse(ReadToaken());
            }
            return arr;
        }

        //write
        static void Write(object text)
        {
            Out.Write(text);
        }
        static void WriteLine(object text = null)
        {
            Out.WriteLine(text);
        }

        #endregion
    }
}

using System;

namespace ProblemB
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(System.IO.File.OpenText("input.txt"));
            DateTime start = GetDate();
            DateTime end = GetDate();

            if(start > end)
            {
                DateTime temp = start;
                start = end;
                end = temp;
            }

            TimeSpan ts = end - start;
            Console.WriteLine(ts.TotalDays);
        }

        private static DateTime GetDate()
        {
            string[] ar = Console.ReadLine().Split(':');
            int year = int.Parse(ar[0]);
            int month = int.Parse(ar[1]);
            int day = int.Parse(ar[2]);
            return new DateTime(year, month, day);
        }
    }
}

/*
 * Сделано в SharpDevelop.
 * Пользователь: admin
 * Дата: 01.02.2013
 * Время: 22:20
 *
 * Для изменения этого шаблона используйте Сервис | Настройка | Кодирование | Правка стандартных заголовков.
 */

using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System;

namespace reshenie
{
	class Program
	{
		public static int ReadInt(){

				return int.Parse(Console.ReadLine());

			}

		public static string[] ReadStrArr(){

				return Console.ReadLine().Split(' ');

			}

	    public static int ToInt(Object a){

			return int.Parse(a.ToString());

			}

		public static void print(int[] mas){

		for (int i =0;i<mas.Length;i++)
			Console.Write(mas[i].ToString()+" ");

		}

		public static int[] ReadIntArray(int n,string[] s){
			int[] a = new int[n];
			for(int i =0;i<n;i++){

				a[i]= ToInt(s[i]);
			}
		return a;
		}
		/*

		 */
		public static void Main(string[] args)
		{
			string[] s = Console.ReadLine().Split(':');
			int y= ToInt(s[0]);
			int m= ToInt(s[1]);
			int d= ToInt(s[2]);

			s = Console.ReadLine().Split(':');
			int y1= ToInt(s[0]);
			int m1= ToInt(s[1]);
			int d1= ToInt(s[2]);
			DateTime dt1= new DateTime(y,m,d);
			DateTime dt2 = new DateTime(y1,m1,d1);
			Console.WriteLine(Math.Abs((dt2-dt1).Days).ToString());

			//Console.ReadKey(true);
		}
	}
}

using System;
using System.Collections;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace op
{
    class Program
    {
        public static void Main(string[] args)
        {
            string[] s1=Console.ReadLine().Split(':');
            DateTime d1=new DateTime(int.Parse(s1[0]),int.Parse(s1[1]),int.Parse(s1[2]));
            string[] s2 = Console.ReadLine().Split(':');
            DateTime d2 = new DateTime(int.Parse(s2[0]), int.Parse(s2[1]), int.Parse(s2[2]));
            Console.WriteLine(Math.Abs((d2 - d1).Days));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] aux = Console.ReadLine().Split(':');
            DateTime t = new DateTime(int.Parse(aux[0]), int.Parse(aux[1]), int.Parse(aux[2]));
            aux = Console.ReadLine().Split(':');
            DateTime t1 = new DateTime(int.Parse(aux[0]), int.Parse(aux[1]), int.Parse(aux[2]));
            Console.WriteLine(Math.Abs(t.CompareTo(t1) > 1 ? (t - t1).TotalDays : (t - t1).TotalDays));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

class Demo
{
    static void Main()
    {
        string ini = Console.ReadLine();
        string fin = Console.ReadLine();
        string[] aini = ini.Split(':');
        string[] afin = fin.Split(':');

        if (ini == fin)
        {
            Console.WriteLine("0");
        }
        else
        {

            int yearini = Convert.ToInt32(aini[0]);
            int monthini = Convert.ToInt32(aini[1]);
            int dayini = Convert.ToInt32(aini[2]);
            int yearfin = Convert.ToInt32(afin[0]);
            int monthfin = Convert.ToInt32(afin[1]);
            int dayfin = Convert.ToInt32(afin[2]);

            int tempyear;
            int tempmonth;
            int tempday;

            if (yearfin < yearini || (yearfin == yearini && monthfin < monthini) || (yearfin == yearini && monthfin == monthini && dayfin < dayini))
            {
                tempyear = yearfin;
                yearfin = yearini;
                yearini = tempyear;

                tempmonth = monthfin;
                monthfin = monthini;
                monthini = tempmonth;

                tempday = dayfin;
                dayfin = dayini;
                dayini = tempday;
            }

            int sol = 0;
            while (true)
            {
                if (dayini == 28 && monthini == 2)
                {
                    if (!B(dayini, monthini, yearini))
                    {
                        dayini = 1;
                        monthini++;
                        sol++;
                        if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                            break;
                    }
                    else
                    {
                        dayini++;
                        sol++;
                    }

                }
                else if (dayini == 29 && monthini == 2)
                {
                    sol++;
                    dayini = 1;
                    monthini++;
                    if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                        break;
                }
                else if (dayini == 30 && (monthini == 4 || monthini == 6 || monthini == 9 || monthini == 11))
                {
                    sol++;
                    dayini = 1;
                    monthini++;
                    if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                        break;
                }
                else if (dayini == 31 && (monthini == 1 || monthini == 3 || monthini == 5 || monthini == 7 || monthini == 8 || monthini == 10))
                {
                    sol++;
                    dayini = 1;
                    monthini++;
                    if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                        break;
                }
                else if (dayini == 31 && monthini == 12)
                {
                    sol++;
                    dayini = 1;
                    monthini = 1;
                    yearini++;
                    if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                        break;
                }
                else
                {
                    dayini++;
                    sol++;
                    if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                        break;
                }
                if (dayini == dayfin && monthini == monthfin && yearini == yearfin)
                    break;
            }
            Console.WriteLine(sol);
        }

    }

    static bool B(int pd, int pm, int pa)
    {
        if (pa % 400 == 0 || (pa % 4 == 0 && pa % 100 != 0))
            return true;
        return false;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime a = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            DateTime b = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            Console.WriteLine(Math.Abs((b-a).TotalDays));
        }
    }
}

using System;
    class Program
    {
        static void Main()
        {
            var line = Console.ReadLine().Split(':');
            int x1 = Convert.ToInt32(line[0]);
            int y1 = Convert.ToInt32(line[1]);
            int z1 = Convert.ToInt32(line[2]);
            line = Console.ReadLine().Split(':');
            int x2 = Convert.ToInt32(line[0]);
            int y2 = Convert.ToInt32(line[1]);
            int z2 = Convert.ToInt32(line[2]);
            DateTime first = new DateTime(x1,y1,z1);
            DateTime second = new DateTime(x2,y2,z2);
            Console.WriteLine(Math.Abs((first-second).Days));
        }
    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {

            String s = Console.ReadLine();
            DateTime t = Convert.ToDateTime(s.Substring(0, 4)+"/"+s.Substring(5, 2)+"/"+s.Substring(8, 2));
            s = Console.ReadLine();
            DateTime t2 = Convert.ToDateTime(s.Substring(0, 4) + "/" + s.Substring(5, 2) + "/" + s.Substring(8, 2));

            Console.Write(""+Math.Abs((t2 - t).Days));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace C
{
    using System.Globalization;
    using System.IO;

    class Program
    {
        static void Main(string[] args)
        {
            string a, b;

            a = Console.ReadLine();
            b = Console.ReadLine();

            var date1str = a.Split(':');
            var date2str = b.Split(':');

            var date1 = new DateTime(Convert.ToInt32(date1str[0]), Convert.ToInt32(date1str[1]), Convert.ToInt32(date1str[2]), new GregorianCalendar());
            var date2 = new DateTime(Convert.ToInt32(date2str[0]), Convert.ToInt32(date2str[1]), Convert.ToInt32(date2str[2]), new GregorianCalendar());

            Console.WriteLine(Math.Abs((date2 - date1).Days));

            return;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] arr = Console.ReadLine().Split(':').ToArray();
            DateTime dtTime1 = new DateTime(int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]));

            string[] arr2 = Console.ReadLine().Split(':').ToArray();
            DateTime dtTime2 = new DateTime(int.Parse(arr2[0]), int.Parse(arr2[1]), int.Parse(arr2[2]));
            Console.Out.WriteLine(Math.Abs((dtTime2-dtTime1).Days));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime dt1 = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            DateTime dt2 = DateTime.Parse(Console.ReadLine().Replace(':', '.'));

            Console.WriteLine(Math.Abs((dt2 - dt1).TotalDays));

        }
    }
}

#define Online
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Threading;

namespace CF
{
    delegate double F(double x);
    delegate decimal Fdec(decimal x);
    class Program
    {

        static void Main(string[] args)
        {

#if FileIO
            StreamReader sr = new StreamReader("input.txt");
            StreamWriter sw = new StreamWriter("output.txt");
            Console.SetIn(sr);
            Console.SetOut(sw);
#endif

            int[] y = new int[2];
            int[] m = new int[2];
            int[] d = new int[2];
            for (int i = 0; i < 2; i++)
            {
                string[] input = Console.ReadLine().Split(':');
                y[i] = int.Parse(input[0]);
                m[i] = int.Parse(input[1]);
                d[i] = int.Parse(input[2]);
            }

            int sum = 0;
            for (int i = Math.Min(y[0],y[1]); i <= Math.Max(y[0],y[1]); i++)
            {
                if (DateTime.IsLeapYear(i))
                    sum += 366;
                else
                    sum += 365;
            }
            int comp = DateTime.Compare(new DateTime(y[0], m[0], d[0]), new DateTime(y[1], m[1], d[1]));
            if (comp < 0)
            {
                sum -= d[0];
                for (int i = 1; i < m[0]; i++)
                    sum -= DateTime.DaysInMonth(y[0], i);
                sum -= DateTime.DaysInMonth(y[1], m[1]) - d[1];
                for (int i = m[1] + 1; i <= 12; i++)
                    sum -= DateTime.DaysInMonth(y[1], i);
            }
            if (comp > 0)
            {
                sum -= d[1];
                for (int i = 1; i < m[1]; i++)
                    sum -= DateTime.DaysInMonth(y[1], i);
                sum -= DateTime.DaysInMonth(y[0], m[0]) - d[0];
                for (int i = m[0] + 1; i <= 12; i++)
                    sum -=DateTime.DaysInMonth(y[0], i);
            }
            if (comp == 0)
            {
                sum = 0;
            }
            Console.WriteLine(sum);

#if Online
            Console.ReadLine();
#endif

#if FileIO
            sr.Close();
            sw.Close();
#endif
        }

        static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
    }

    public static class MyMath
    {
        public static long BinPow(long a, long n, long mod)
        {
            long res = 1;
            while (n > 0)
            {
                if ((n & 1) == 1)
                {
                    res = (res * a) % mod;
                }
                a = (a * a) % mod;
                n >>= 1;
            }
            return res;
        }
    }

    public class SegmentTree
    {
        int[] v_min;
        int[] v_max;
        int[] mas;
        public void BuildTree(int[] a)
        {
            int n = a.Length - 1;
            int z = 0;
            while (n >= 2)
            {
                z++;
                n >>= 1;
            }
            n = 1 << (z + 1);
            v_min = new int[n << 1];
            v_max = new int[n << 1];
            mas = new int[n << 1];
            for (int i = n; i < n + a.Length; i++)
                v_min[i] = a[i - n];
            for (int i = n + a.Length; i < v_min.Length; i++)
                v_min[i] = int.MaxValue;
            for (int i = n - 1; i > 0; i--)
                v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);

            for (int i = n; i < n + a.Length; i++)
                v_max[i] = a[i - n];
            for (int i = n + a.Length; i < v_max.Length; i++)
                v_max[i] = int.MinValue;
            for (int i = n - 1; i > 0; i--)
                v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);

        }
        //nil
        public int RMQ_MIN(int l, int r)
        {
            int ans = int.MaxValue;
            l += v_min.Length >> 1;
            r += v_min.Length >> 1;
            const int o = 1;
            while (l <= r)
            {
                if ((l & 1) == o)
                    ans = Math.Min(ans, v_min[l]);
                if (!((r & 1) == 0))
                    ans = Math.Min(ans, v_min[r]);
                l = (l + 1) >> 1;
                r = (r - 1) >> 1;
            }
            return ans;
        }

        public int RMQ_MAX(int l, int r)
        {
            int ans = int.MinValue;
            l += v_max.Length >> 1;
            r += v_max.Length >> 1;
            const int o = 1;
            while (l <= r)
            {
                if ((l & 1) == o)
                    ans = Math.Max(ans, v_max[l]);
                if (!((r & 1) == 0))
                    ans = Math.Max(ans, v_max[r]);
                l = (l + 1) >> 1;
                r = (r - 1) >> 1;
            }
            return ans;
        }

        public void Put(int l, int r, int op)
        {
            l += mas.Length >> 1;
            r += mas.Length >> 1;
            while (l <= r)
            {
                if (l % 2 != 0)
                    mas[l] = op;
                if (r % 2 == 0)
                    mas[r] = op;
                l = (l + 1) >> 1;
                r = (r - 1) >> 1;
            }
        }

        public int Get(int x)
        {
            x += mas.Length >> 1;
            int ans = int.MinValue;
            while (x > 0)
            {
                ans = Math.Max(mas[x], ans);
                x >>= 1;
            }
            return ans;
        }

        public void Update(int i, int x)
        {
            i += v_min.Length >> 1;
            v_min[i] = x;
            v_max[i] = x;
            i >>= 1;
            while (i > 0)
            {
                v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);
                v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);
                i >>= 1;
            }
        }
    }
    class Edge
    {
        public int a;
        public int b;
        public int w;

        public Edge(int a, int b, int w)
        {
            this.a = a;
            this.b = b;
            this.w = w;
        }
    }
    class Graph
    {
        public List<List<int>> g = new List<List<int>>();
        public List<Edge> e = new List<Edge>();
        public Stack<int> s;
        public List<bool> u;
        public List<int> d; //длина
        public List<int> p; //путь
        public Queue<int> q;
        public int n;
        public int start;
        public int finish;
        public Graph(int n)
        {
            for (int i = 0; i <= n; i++)
                g.Add(new List<int>());
            p = new List<int>();
            d = new List<int>();
            for (int i = 0; i <= n; i++)
                p.Add(-1);
            for (int i = 0; i <= n; i++)
                d.Add(-1);
            u = new List<bool>();
            for (int i = 0; i <= n; i++)
                u.Add(true);
            this.n = n;
        }

        public bool dfs1(int v)
        {
            u[v] = false;
            for (int i = 0; i < g[v].Count; i++)
            {
                if (u[g[v][i]])
                {
                    p[g[v][i]] = v;
                    if (dfs1(g[v][i])) return true;
                }
                else
                {
                    if (p[v] != g[v][i])
                    {
                        start = v;
                        finish = g[v][i];
                        return true;
                    }
                }
            }
            return false;
        }

        public void dfs2(int v)
        {
            s = new Stack<int>();
            s.Push(v);
            int cur;
            bool all;
            while (s.Count != 0)
            {
                cur = s.Peek();
                all = true;
                for (int i = 0; i < g[cur].Count; i++)
                {
                    if (d[g[cur][i]] == -1)
                    {
                        s.Push(g[cur][i]);
                        d[g[cur][i]] = d[cur] + 1;
                        all = false;
                    }
                }
                if (all)
                    s.Pop();
            }
        }

        public void DFS(int v)
        {
            s = new Stack<int>();

            s.Push(v);
            int cur;
            bool all;
            while (s.Count != 0)
            {
                cur = s.Peek();
                u[cur] = false;
                all = true;
                for (int i = 0; i < g[cur].Count; i++)
                {
                    if (u[g[cur][i]])
                    {
                        all = false;
                        p[g[cur][i]] = cur;
                        s.Push(g[cur][i]);
                    }
                    else
                    {
                        if (p[cur] != g[cur][i])
                        {
                            start = cur;
                            finish = g[cur][i];
                            return;
                        }
                    }
                }
                if (all)
                    s.Pop();
            }
        }

        public void BFS(params int[] v)
        {
            q = new Queue<int>();
            u = new List<bool>();
            d = new List<int>();
            p = new List<int>();

            for (int i = 0; i <= n; i++)
            {
                u.Add(true);
                d.Add(0);
                p.Add(0);
            }

            q.Enqueue(v[0]);
            u[v[0]] = false;
            int cur;

            while (q.Count != 0)
            {
                cur = q.Dequeue();
                for (int i = 0; i < g[cur].Count; i++)
                    if (u[g[cur][i]])
                    {
                        q.Enqueue(g[cur][i]);
                        u[g[cur][i]] = false;
                        p[g[cur][i]] = cur;
                        d[g[cur][i]] = d[cur] + 1;
                    }
            }

            int from = v[1];
            string path = from + "";
            while (p[from] != 0)
            {
                path = p[from] + " " + path;
                from = p[from];
            }
            Console.WriteLine(d[v[1]] + " : " + path);
        }

        public void FordBellman(params int[] v)
        {
            d = new List<int>();
            p = new List<int>();
            for (int i = 0; i <= n; i++)
            {
                d.Add(int.MaxValue);
                p.Add(0);
            }
            d[v[0]] = 0;

            for (int i = 0; i < n - 1; i++)
            {
                for (int j = 0; j < e.Count; j++)
                {
                    if (d[e[j].a] != int.MaxValue)
                    {
                        if (d[e[j].a] + e[j].w < d[e[j].b])
                        {
                            d[e[j].b] = d[e[j].a] + e[j].w;
                            p[e[j].b] = e[j].a;
                        }
                    }
                }
            }

            int from = v[1];

            if (d[from] == int.MaxValue)
            {
                Console.WriteLine("Can't find the minimal path");
                return;
            }

            string ans = from + "";
            while (p[from] != 0)
            {
                ans = p[from] + " " + ans;
                from = p[from];
            }

            Console.WriteLine(d[v[1]] + " : " + ans);
        }
    }
    static class ArrayUtils
    {
        public static int BinarySearch(int[] a, int val)
        {
            int left = 0;
            int right = a.Length - 1;
            int mid;

            while (left < right)
            {
                mid = left + ((right - left) >> 1);
                if (val <= a[mid])
                {
                    right = mid;
                }
                else
                {
                    left = mid + 1;
                }
            }

            if (a[left] == val)
                return left;
            else
                return -1;
        }

        public static double Bisection(F f, double left, double right, double eps)
        {
            double mid;
            while (right - left > eps)
            {
                mid = left + ((right - left) / 2d);
                if (Math.Sign(f(mid)) != Math.Sign(f(left)))
                    right = mid;
                else
                    left = mid;
            }
            return (left + right) / 2d;
        }

        public static decimal TernarySearchDec(Fdec f, decimal eps, decimal l, decimal r, bool isMax)
        {
            decimal m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3m;
                m2 = r - (r - l) / 3m;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static double TernarySearch(F f, double eps, double l, double r, bool isMax)
        {
            double m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3d;
                m2 = r - (r - l) / 3d;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable<T>
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (L[i].CompareTo(R[j]) <= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R);
            Merge_Sort(A, q + 1, r, L, R);
            Merge(A, p, q, r, L, R);
        }

        static void Shake<T>(T[] a)
        {
            Random rnd = new Random(Environment.TickCount);
            T temp;
            int b, c;
            for (int i = 0; i < a.Length; i++)
            {
                b = rnd.Next(0, a.Length);
                c = rnd.Next(0, a.Length);
                temp = a[b];
                a[b] = a[c];
                a[c] = temp;
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s1 = Console.ReadLine().Split(':');
            string[] s2 = Console.ReadLine().Split(':');
            DateTime d1 = new DateTime(int.Parse(s1[0]), int.Parse(s1[1]), int.Parse(s1[2]));
            DateTime d2 = new DateTime(int.Parse(s2[0]), int.Parse(s2[1]), int.Parse(s2[2]));
            Console.WriteLine(d2.Subtract(d1).Days < 0 ? -d2.Subtract(d1).Days : d2.Subtract(d1).Days);
        }
    }
}

using System;
namespace _304B
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime date1 = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            DateTime date2 = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            Console.Write(Math.Abs((date1 - date2).TotalDays));
        }
    }
}

using System;
using System.Numerics;
namespace _304B
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime date1 = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            DateTime date2 = DateTime.Parse(Console.ReadLine().Replace(':', '.'));
            Console.Write(Math.Abs((date1 - date2).TotalDays));
        }
    }
}

using System;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var tok1 = Console.ReadLine().Split(':');
            int y1 = Convert.ToInt32(tok1[0]), m1 = Convert.ToInt32(tok1[1]), d1 = Convert.ToInt32(tok1[2]);
            tok1 = Console.ReadLine().Split(':');
            int y2 = Convert.ToInt32(tok1[0]), m2 = Convert.ToInt32(tok1[1]), d2 = Convert.ToInt32(tok1[2]);
            DateTime a = new DateTime(y1,m1,d1);
            DateTime b = new DateTime(y2,m2,d2);
            Console.WriteLine(Math.Abs((b-a).Days));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5
{
    class Program
    {
        public static bool IsLeapYear(int year)
        {
            if (year % 400 == 0) return true;
            else return (year % 4 == 0 && year % 100 != 0);
        }

        public static int DaysInMonth(int N,int year)
        {
            if (N == 1 || N == 3 || N == 5 || N == 7 || N == 8 || N == 10 || N == 12) return 31;
            if (N == 4 || N == 6 || N == 9 || N == 11) return 30;
            if (IsLeapYear(year)) return 29;
            else return 28;
        }

        public static void swap(ref int a,ref int b)
       {
            int k=a; a=b; b=k;
       }

        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            int dm, year1, year2, month1, month2, day1, day2, ans=0;

            year1 = (s[0] - 48) * 1000 + (s[1] - 48) * 100 + (s[2] - 48) * 10 + (s[3] - 48);
            month1 = (s[5] - 48) * 10 + (s[6] - 48);
            day1 = (s[8] - 48) * 10 + (s[9] - 48);

            s = Console.ReadLine();
            year2 = (s[0] - 48) * 1000 + (s[1] - 48) * 100 + (s[2] - 48) * 10 + (s[3] - 48);
            month2 = (s[5] - 48) * 10 + (s[6] - 48);
            day2 = (s[8] - 48) * 10 + (s[9] - 48);

            //if first date is bigger, swap dates
            if (year1 > year2) { swap(ref year1, ref year2); swap(ref month1, ref month2); swap(ref day1, ref day2); }
            else if (year1 == year2 && month1 > month2) { swap(ref month1, ref month2); swap(ref day1, ref day2); }
            else if (year1 == year2 && month1 == month2 && day1 > day2) { swap(ref day1, ref day2); }

            //case 1
            if (year1 == year2)
            {
                if (month1 == month2) ans += (day2 - day1);
                else
                {
                    dm = DaysInMonth(month1, year1);
                    ans += (dm - day1);
                    day1 = 0; month1++;
                    while (month1 < month2)
                    {
                        dm = DaysInMonth(month1, year1);
                        ans += dm;
                        month1++;
                    }
                    ans += (day2 - day1);
                }
            }
            else //case 2
            {
                //round up first date
                dm = DaysInMonth(month1, year1);
                ans += (dm - day1);
                day1 = 0; ++month1; if (month1 == 13) month1 = 1;
                while (month1 != 1)
                {
                    dm = DaysInMonth(month1, year1);
                    ans += dm;
                    if(month1==12)month1=1; else ++month1;
                }
                ++year1;

                //round down second date
                ans += day2; day2 = 0; month2--;
                while (month2 != 0)
                {
                    dm = DaysInMonth(month2, year2);
                    ans += dm;
                    --month2;
                }
                //add days of years
                for (int i = year1; i < year2; ++i)
                    if (IsLeapYear(i)) ans += 366; else ans += 365;
            }

            Console.WriteLine("{0}",ans);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s1=Console.ReadLine().Split(':');
            DateTime d1=new DateTime(int.Parse(s1[0]),int.Parse(s1[1]),int.Parse(s1[2]));
            string[] s2 = Console.ReadLine().Split(':');
            DateTime d2 = new DateTime(int.Parse(s2[0]), int.Parse(s2[1]), int.Parse(s2[2]));
            Console.WriteLine(Math.Abs((d2 - d1).Days));
        }
    }
}

/*
 * Created by SharpDevelop.
 * User: IdM
 * Date: 12.05.2013
 * Time: 18:24
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace r183_2
{
	class Program
	{
		public static void Main(string[] args)
		{
			string str = Console.ReadLine();
			string[] strArr = str.Split(':');
			int[] dat1 = new int[3];
			for (int i = 0; i < 3; i++) {
				dat1[i] = int.Parse(strArr[i]);
			}

			str = Console.ReadLine();
			strArr = str.Split(':');
			int[] dat2 = new int[3];
			for (int i = 0; i < 3; i++) {
				dat2[i] = int.Parse(strArr[i]);
			}

			DateTime d1 = new DateTime(dat1[0], dat1[1], dat1[2]);
		    DateTime d2 = new DateTime(dat2[0], dat2[1], dat2[2]);
		    TimeSpan time = d2 - d1;

		    Console.WriteLine(Math.Abs(time.Days));

//			Console.Write("Press any key to continue . . . ");
//			Console.ReadKey(true);
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Program
    {

        static void Main(string[] args)
        {

            string[] d1,d2,aux;

            d1 =Console.ReadLine().Split(':');
            d2 = Console.ReadLine().Split(':');

            DateTime data1 = new DateTime(int.Parse(d1[0]), int.Parse(d1[1]), int.Parse(d1[2])), data2 = new DateTime(int.Parse(d2[0]), int.Parse(d2[1]), int.Parse(d2[2]));
            if (data1 > data2)
            {
                aux = d1;
                d1 = d2;
                d2 = aux;
            }
            int aa = int.Parse(d1[0]), aa1 = int.Parse(d2[0]), dd = int.Parse(d1[2]), dd1= int.Parse(d2[2]) , mm = int.Parse(d1[1]), mm1 = int.Parse(d2[1]), difdias = 0, mesAno = 12;
            int[] numDias = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            for (; aa <= aa1; aa++)
            {
                // Console.Write("{0}/", aa);
                if ((((aa % 4) == 0 && (aa % 100) != 0) || (aa % 400) == 0))
                    numDias[1] = 29;
                else
                    numDias[1] = 28;

                if (mm == 13)
                    mm = 1;

                for (; mm <= mesAno; mm++)
                {
                    //Console.Write("{0}/{1}   dif = {2} \n", aa,mm,difdias);
                    if (aa == aa1 && mm == mm1)
                    {
                        mesAno = mm;
                        numDias[mm - 1] = dd1;
                    }
                    for (; dd <= numDias[mm - 1]; dd++)
                    {
                        //Console.Write("{0} -", dd);
                        if (aa != aa1 || mm != mm1 || dd != dd1)
                        {
                            difdias++;

                        }

                    }
                    dd = 1;
                    //Console.WriteLine("\n");
                }
            }
            Console.WriteLine(difdias);
            //Console.ReadKey();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Program
    {

        static void Main(string[] args)
        {

            string[] d1,d2,aux;
            // separa o valor lido usando o ':'
            d1 =Console.ReadLine().Split(':');
            d2 = Console.ReadLine().Split(':');
            //Insere os valores separados de maneira correta em um tipo date
            DateTime data1 = new DateTime(int.Parse(d1[0]), int.Parse(d1[1]), int.Parse(d1[2])), data2 = new DateTime(int.Parse(d2[0]), int.Parse(d2[1]), int.Parse(d2[2]));
            // verifica se Data1 é maior que Data2 para fazer a inversão se necessario
            if (data1 > data2)
            {
                aux = d1;
                d1 = d2;
                d2 = aux;
            }
            //Define os valores nas variaveis que serão usadas usadas
            int aa = int.Parse(d1[0]), aa1 = int.Parse(d2[0]), dd = int.Parse(d1[2]), dd1= int.Parse(d2[2]) , mm = int.Parse(d1[1]), mm1 = int.Parse(d2[1]), difdias = 0, mesAno = 12;
            // variavel que armazena numero de dias de cada mes
            int[] numDias = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            for (; aa <= aa1; aa++)// contador ANO
            {
                // SE ano bissexto
                if ((((aa % 4) == 0 && (aa % 100) != 0) || (aa % 400) == 0))
                    numDias[1] = 29;
                else
                    numDias[1] = 28;
                //se mes passar de 12 volta a ser 1
                if (mm == 13)
                    mm = 1;

                for (; mm <= mesAno; mm++)// Contador MES
                {
                   //verifica se esta no mesmo mes e ano para definir ate qual dia contar
                    if (aa == aa1 && mm == mm1)
                    {
                        mesAno = mm;
                        numDias[mm - 1] = dd1;
                    }

                    for (; dd <= numDias[mm - 1]; dd++)// contador dias
                    {

                        if (aa != aa1 || mm != mm1 || dd != dd1) // conta dias enquanto algum dos valores são diferentes
                        {
                            difdias++;

                        }

                    }
                    dd = 1;

                }
            }
            Console.WriteLine(difdias);

        }
    }
}

using System;

class Program_304B
{
    static void Main()
    {
        string[] s = Console.ReadLine().Split(':');
        DateTime a = new DateTime(Int16.Parse(s[0]), Int16.Parse(s[1]), Int16.Parse(s[2]));
        s = Console.ReadLine().Split(':');
        DateTime b = new DateTime(Int16.Parse(s[0]), Int16.Parse(s[1]), Int16.Parse(s[2]));
        Console.WriteLine(Math.Abs((b - a).TotalDays));
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace ConsoleApplication30
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            string firstDate = Console.ReadLine().Replace(':', ',');
            string secondDate = Console.ReadLine().Replace(':', ',');

            DateTime dateTimeFirst = DateTime.Parse(firstDate);
            DateTime dateTimeSecond = DateTime.Parse(secondDate);
            Console.WriteLine(Math.Abs((dateTimeSecond - dateTimeFirst).TotalDays));

            Console.ReadLine();
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static void Read(out int n1, out int n2)
        {
            string[] input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
        }

        private static void Read(out int n1, out int n2, out int n3)
        {
            string[] input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
            n3 = int.Parse(input[2]);
        }

        private static void Read(out int n1, out int n2, out int n3, out int n4)
        {
            string[] input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
            n3 = int.Parse(input[2]);
            n4 = int.Parse(input[3]);
        }

        private static void Read<T>(out T a1, out T a2)
        {
            string[] input = ReadArray();
            a1 = (T) Convert.ChangeType(input[0], typeof (T));
            a2 = (T) Convert.ChangeType(input[1], typeof (T));
        }

        private static void Read<T>(out T a1, out T a2, out T a3)
        {
            string[] input = ReadArray();
            a1 = (T) Convert.ChangeType(input[0], typeof (T));
            a2 = (T) Convert.ChangeType(input[1], typeof (T));
            a3 = (T) Convert.ChangeType(input[2], typeof (T));
        }

        private static void Read<T>(out T a1, out T a2, out T a3, out T a4)
        {
            string[] input = ReadArray();
            a1 = (T) Convert.ChangeType(input[0], typeof (T));
            a2 = (T) Convert.ChangeType(input[1], typeof (T));
            a3 = (T) Convert.ChangeType(input[2], typeof (T));
            a4 = (T) Convert.ChangeType(input[3], typeof (T));
        }

        private static int ReadInt()
        {
            return Int32.Parse(Read());
        }

        private static long ReadLong()
        {
            return long.Parse(Read());
        }

        private static double ReadDouble()
        {
            return double.Parse(Read(), CultureInfo.InvariantCulture);
        }

        private static T Read<T>()
        {
            return (T) Convert.ChangeType(Read(), typeof (T));
        }

        private static string[] ReadArray()
        {
            string readLine = Console.ReadLine();
            if (readLine != null)
                return readLine.Split(' ');

            throw new ArgumentException();
        }

        private static List<int> ReadIntArray()
        {
            return ReadArray().Select(Int32.Parse).ToList();
        }

        private static List<long> ReadLongArray()
        {
            return ReadArray().Select(long.Parse).ToList();
        }

        private static List<double> ReadDoubleArray()
        {
            return ReadArray().Select(d => double.Parse(d, CultureInfo.InvariantCulture)).ToList();
        }

        private static List<T> ReadArray<T>()
        {
            return ReadArray().Select(x => (T) Convert.ChangeType(x, typeof (T))).ToList();
        }

        private static void WriteLine(int value)
        {
            Console.WriteLine(value);
        }

        private static void WriteLine(double value)
        {
            Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));
        }

        private static void WriteLine(long value)
        {
            Console.WriteLine(value);
        }

        private static void WriteLine(double value, string stringFormat)
        {
            Console.WriteLine(value.ToString(stringFormat, CultureInfo.InvariantCulture));
        }

        private static void WriteLine<T>(T value)
        {
            Console.WriteLine(value);
        }

        private static void Write(int value)
        {
            Console.Write(value);
        }

        private static void Write(double value)
        {
            Console.Write(value.ToString(CultureInfo.InvariantCulture));
        }

        private static void Write(long value)
        {
            Console.Write(value);
        }

        private static void Write(double value, string stringFormat)
        {
            Console.Write(value.ToString(stringFormat, CultureInfo.InvariantCulture));
        }

        private static void Write<T>(T value)
        {
            Console.Write(value);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class B
    {
        public void Run()
        {
            int[] str = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();
            int[] str2 = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();

            DateTime d1 = new DateTime(str[0], str[1], str[2]);
            DateTime d2 = new DateTime(str2[0], str2[1], str2[2]);

            TimeSpan ts = d2 - d1;

            Console.WriteLine(Math.Abs(ts.Days));
        }
    }

    class Programm
    {
        static void Main(string[] args)
        {
            B a = new B();
            a.Run();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class R183_Div2_B
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(':');
            int y1 = int.Parse(s[0]);
            int m1 = int.Parse(s[1]);
            int d1 = int.Parse(s[2]);

            s = Console.ReadLine().Split(':');
            int y2 = int.Parse(s[0]);
            int m2 = int.Parse(s[1]);
            int d2 = int.Parse(s[2]);

            DateTime dt1 = new DateTime(y1, m1, d1);
            DateTime dt2 = new DateTime(y2, m2, d2);
            DateTime t = new DateTime();
            int cnt = 0;
            if (dt2.CompareTo(dt1) > 0)
            {
                t = dt1; dt1 = dt2; dt2 = t;
            }
            cnt = dt1.Subtract(dt2).Days;

            Console.WriteLine(cnt);
        }
    }
}

using System;

namespace Codeforce {
    class Program {
        static void Main() {
            var date1 = Console.ReadLine().Split(':');
            var date2 = Console.ReadLine().Split(':');

            var dt1 = new DateTime(int.Parse(date1[0]), int.Parse(date1[1]), int.Parse(date1[2]));
            var dt2 = new DateTime(int.Parse(date2[0]), int.Parse(date2[1]), int.Parse(date2[2]));

            Console.WriteLine(Math.Abs((dt2 - dt1).Days).ToString());
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class A
    {
        public void Run()
        {
            //int n = int.Parse(Console.ReadLine());
            //int[] m = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            //string str = Console.ReadLine();

        }
    }
    class B
    {

        public void Run()
        {
            int[] str = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();
            int[] str2 = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();

            DateTime d1 = new DateTime(str[0], str[1], str[2]);
            DateTime d2 = new DateTime(str2[0], str2[1], str2[2]);

            TimeSpan ts = d2 - d1;

            Console.WriteLine(Math.Abs(ts.Days));
        }
    }

    class Programm
    {
        static void Main(string[] args)
        {
            B a = new B();
            a.Run();
        }
    }
}

using System;
class Program
{
    static void Main()
    {
        Console.WriteLine(Math.Abs((Convert.ToDateTime(Console.ReadLine().Replace(':', '/')) - Convert.ToDateTime(Console.ReadLine().Replace(':', '/'))).TotalDays));

    }
 }

using System;
class Program
{
		public static void Main()
		{
			string[] tokens = Console.ReadLine().Split(':');
            int a,b,c;
            a = int.Parse(tokens[0]);
            b = int.Parse(tokens[1]);
            c =	int.Parse(tokens[2]);
			DateTime d = new DateTime(a,b,c);
			string[] tokens1 = Console.ReadLine().Split(':');

            a = int.Parse(tokens1[0]);
            b = int.Parse(tokens1[1]);
            c =	int.Parse(tokens1[2]);
			DateTime d1 = new DateTime(a,b,c);
			DateTime s;
			int k=0;
			if(d>d1)
			{
			  s=d;
			  d=d1;
			  d1=s;
			}
			while(d!=d1)
			{
				d=d.AddDays(1);
				k++;
			}

			Console.WriteLine(k);

		}
}

using System.IO;
using System;
using System.Globalization;

class Program
{
    static void Main()
    {
        string s1 = Console.ReadLine();
        string s2 = Console.ReadLine();

        var d1 = DateTime.ParseExact(s1, "yyyy:MM:dd", CultureInfo.InvariantCulture);
        var d2 = DateTime.ParseExact(s2, "yyyy:MM:dd", CultureInfo.InvariantCulture);

        var t1 = d2 - d1;
        Console.WriteLine(t1.TotalDays);
    }
}

using System;

namespace CF.B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] d1 = Console.ReadLine().Split(new char[] { ':' });
            string[] d2 = Console.ReadLine().Split(new char[] { ':' });
            DateTime dt1 = new DateTime(Convert.ToInt32(d1[0]), Convert.ToInt32(d1[1]), Convert.ToInt32(d1[2]));
            DateTime dt2 = new DateTime(Convert.ToInt32(d2[0]), Convert.ToInt32(d2[1]), Convert.ToInt32(d2[2]));
            TimeSpan ts = dt2 - dt1;
            Console.WriteLine(ts.Days);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] aux = Console.ReadLine().Split(':');
            DateTime t = new DateTime(int.Parse(aux[0]), int.Parse(aux[1]), int.Parse(aux[2]));
            aux = Console.ReadLine().Split(':');
            DateTime t1 = new DateTime(int.Parse(aux[0]), int.Parse(aux[1]), int.Parse(aux[2]));
            Console.WriteLine(t.CompareTo(t1) > 1 ? (t - t1).TotalDays : (t1 - t).TotalDays);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] aux = Console.ReadLine().Split(':');
            DateTime t = new DateTime(int.Parse(aux[0]), int.Parse(aux[1]), int.Parse(aux[2]));
            aux = Console.ReadLine().Split(':');
            DateTime t1 = new DateTime(int.Parse(aux[0]), int.Parse(aux[1]), int.Parse(aux[2]));
            Console.WriteLine((t - t1).TotalDays);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {

            String s = Console.ReadLine();
            DateTime t = Convert.ToDateTime(s.Substring(0, 4)+"/"+s.Substring(5, 2)+"/"+s.Substring(8, 2));
            s = Console.ReadLine();
            DateTime t2 = Convert.ToDateTime(s.Substring(0, 4) + "/" + s.Substring(5, 2) + "/" + s.Substring(8, 2));

            Console.Write("" + (t2 - t).Days);
        }
    }
}

#define Online
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Threading;

namespace CF
{
    delegate double F(double x);
    delegate decimal Fdec(decimal x);
    class Program
    {

        static void Main(string[] args)
        {

#if FileIO
            StreamReader sr = new StreamReader("input.txt");
            StreamWriter sw = new StreamWriter("output.txt");
            Console.SetIn(sr);
            Console.SetOut(sw);
#endif

            int[] y = new int[2];
            int[] m = new int[2];
            int[] d = new int[2];
            for (int i = 0; i < 2; i++)
            {
                string[] input = Console.ReadLine().Split(':');
                y[i] = int.Parse(input[0]);
                m[i] = int.Parse(input[1]);
                d[i] = int.Parse(input[2]);
            }

            int sum = 0;
            for (int i = Math.Min(y[0],y[1]); i <= Math.Max(y[0],y[1]); i++)
            {
                if (DateTime.IsLeapYear(i))
                    sum += 366;
                else
                    sum += 365;
            }
            int comp = DateTime.Compare(new DateTime(y[0], m[0], d[0]), new DateTime(y[1], m[1], d[1]));
            if (comp < 0)
            {
                sum -= d[0];
                for (int i = 1; i < m[0]; i++)
                    sum -= DateTime.DaysInMonth(y[0], i);
                sum -= DateTime.DaysInMonth(y[1], m[1]) - d[1];
                for (int i = m[1] + 1; i <= 12; i++)
                    sum -= DateTime.DaysInMonth(y[1], i);
            }
            if (comp > 0)
            {
                sum -= d[1];
                for (int i = 1; i < m[1]; i++)
                    sum -= DateTime.DaysInMonth(y[1], i);
                sum -= DateTime.DaysInMonth(y[0], m[0]) - d[0];
                for (int i = m[0] + 1; i <= 12; i++)
                    sum -=DateTime.DaysInMonth(y[0], i);
            }
            if (comp == 0)
            {
                sum = 1;
            }
            Console.WriteLine(sum);

#if Online
            Console.ReadLine();
#endif

#if FileIO
            sr.Close();
            sw.Close();
#endif
        }

        static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
    }

    public static class MyMath
    {
        public static long BinPow(long a, long n, long mod)
        {
            long res = 1;
            while (n > 0)
            {
                if ((n & 1) == 1)
                {
                    res = (res * a) % mod;
                }
                a = (a * a) % mod;
                n >>= 1;
            }
            return res;
        }
    }

    public class SegmentTree
    {
        int[] v_min;
        int[] v_max;
        int[] mas;
        public void BuildTree(int[] a)
        {
            int n = a.Length - 1;
            int z = 0;
            while (n >= 2)
            {
                z++;
                n >>= 1;
            }
            n = 1 << (z + 1);
            v_min = new int[n << 1];
            v_max = new int[n << 1];
            mas = new int[n << 1];
            for (int i = n; i < n + a.Length; i++)
                v_min[i] = a[i - n];
            for (int i = n + a.Length; i < v_min.Length; i++)
                v_min[i] = int.MaxValue;
            for (int i = n - 1; i > 0; i--)
                v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);

            for (int i = n; i < n + a.Length; i++)
                v_max[i] = a[i - n];
            for (int i = n + a.Length; i < v_max.Length; i++)
                v_max[i] = int.MinValue;
            for (int i = n - 1; i > 0; i--)
                v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);

        }
        //nil
        public int RMQ_MIN(int l, int r)
        {
            int ans = int.MaxValue;
            l += v_min.Length >> 1;
            r += v_min.Length >> 1;
            const int o = 1;
            while (l <= r)
            {
                if ((l & 1) == o)
                    ans = Math.Min(ans, v_min[l]);
                if (!((r & 1) == 0))
                    ans = Math.Min(ans, v_min[r]);
                l = (l + 1) >> 1;
                r = (r - 1) >> 1;
            }
            return ans;
        }

        public int RMQ_MAX(int l, int r)
        {
            int ans = int.MinValue;
            l += v_max.Length >> 1;
            r += v_max.Length >> 1;
            const int o = 1;
            while (l <= r)
            {
                if ((l & 1) == o)
                    ans = Math.Max(ans, v_max[l]);
                if (!((r & 1) == 0))
                    ans = Math.Max(ans, v_max[r]);
                l = (l + 1) >> 1;
                r = (r - 1) >> 1;
            }
            return ans;
        }

        public void Put(int l, int r, int op)
        {
            l += mas.Length >> 1;
            r += mas.Length >> 1;
            while (l <= r)
            {
                if (l % 2 != 0)
                    mas[l] = op;
                if (r % 2 == 0)
                    mas[r] = op;
                l = (l + 1) >> 1;
                r = (r - 1) >> 1;
            }
        }

        public int Get(int x)
        {
            x += mas.Length >> 1;
            int ans = int.MinValue;
            while (x > 0)
            {
                ans = Math.Max(mas[x], ans);
                x >>= 1;
            }
            return ans;
        }

        public void Update(int i, int x)
        {
            i += v_min.Length >> 1;
            v_min[i] = x;
            v_max[i] = x;
            i >>= 1;
            while (i > 0)
            {
                v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);
                v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);
                i >>= 1;
            }
        }
    }
    class Edge
    {
        public int a;
        public int b;
        public int w;

        public Edge(int a, int b, int w)
        {
            this.a = a;
            this.b = b;
            this.w = w;
        }
    }
    class Graph
    {
        public List<List<int>> g = new List<List<int>>();
        public List<Edge> e = new List<Edge>();
        public Stack<int> s;
        public List<bool> u;
        public List<int> d; //длина
        public List<int> p; //путь
        public Queue<int> q;
        public int n;
        public int start;
        public int finish;
        public Graph(int n)
        {
            for (int i = 0; i <= n; i++)
                g.Add(new List<int>());
            p = new List<int>();
            d = new List<int>();
            for (int i = 0; i <= n; i++)
                p.Add(-1);
            for (int i = 0; i <= n; i++)
                d.Add(-1);
            u = new List<bool>();
            for (int i = 0; i <= n; i++)
                u.Add(true);
            this.n = n;
        }

        public bool dfs1(int v)
        {
            u[v] = false;
            for (int i = 0; i < g[v].Count; i++)
            {
                if (u[g[v][i]])
                {
                    p[g[v][i]] = v;
                    if (dfs1(g[v][i])) return true;
                }
                else
                {
                    if (p[v] != g[v][i])
                    {
                        start = v;
                        finish = g[v][i];
                        return true;
                    }
                }
            }
            return false;
        }

        public void dfs2(int v)
        {
            s = new Stack<int>();
            s.Push(v);
            int cur;
            bool all;
            while (s.Count != 0)
            {
                cur = s.Peek();
                all = true;
                for (int i = 0; i < g[cur].Count; i++)
                {
                    if (d[g[cur][i]] == -1)
                    {
                        s.Push(g[cur][i]);
                        d[g[cur][i]] = d[cur] + 1;
                        all = false;
                    }
                }
                if (all)
                    s.Pop();
            }
        }

        public void DFS(int v)
        {
            s = new Stack<int>();

            s.Push(v);
            int cur;
            bool all;
            while (s.Count != 0)
            {
                cur = s.Peek();
                u[cur] = false;
                all = true;
                for (int i = 0; i < g[cur].Count; i++)
                {
                    if (u[g[cur][i]])
                    {
                        all = false;
                        p[g[cur][i]] = cur;
                        s.Push(g[cur][i]);
                    }
                    else
                    {
                        if (p[cur] != g[cur][i])
                        {
                            start = cur;
                            finish = g[cur][i];
                            return;
                        }
                    }
                }
                if (all)
                    s.Pop();
            }
        }

        public void BFS(params int[] v)
        {
            q = new Queue<int>();
            u = new List<bool>();
            d = new List<int>();
            p = new List<int>();

            for (int i = 0; i <= n; i++)
            {
                u.Add(true);
                d.Add(0);
                p.Add(0);
            }

            q.Enqueue(v[0]);
            u[v[0]] = false;
            int cur;

            while (q.Count != 0)
            {
                cur = q.Dequeue();
                for (int i = 0; i < g[cur].Count; i++)
                    if (u[g[cur][i]])
                    {
                        q.Enqueue(g[cur][i]);
                        u[g[cur][i]] = false;
                        p[g[cur][i]] = cur;
                        d[g[cur][i]] = d[cur] + 1;
                    }
            }

            int from = v[1];
            string path = from + "";
            while (p[from] != 0)
            {
                path = p[from] + " " + path;
                from = p[from];
            }
            Console.WriteLine(d[v[1]] + " : " + path);
        }

        public void FordBellman(params int[] v)
        {
            d = new List<int>();
            p = new List<int>();
            for (int i = 0; i <= n; i++)
            {
                d.Add(int.MaxValue);
                p.Add(0);
            }
            d[v[0]] = 0;

            for (int i = 0; i < n - 1; i++)
            {
                for (int j = 0; j < e.Count; j++)
                {
                    if (d[e[j].a] != int.MaxValue)
                    {
                        if (d[e[j].a] + e[j].w < d[e[j].b])
                        {
                            d[e[j].b] = d[e[j].a] + e[j].w;
                            p[e[j].b] = e[j].a;
                        }
                    }
                }
            }

            int from = v[1];

            if (d[from] == int.MaxValue)
            {
                Console.WriteLine("Can't find the minimal path");
                return;
            }

            string ans = from + "";
            while (p[from] != 0)
            {
                ans = p[from] + " " + ans;
                from = p[from];
            }

            Console.WriteLine(d[v[1]] + " : " + ans);
        }
    }
    static class ArrayUtils
    {
        public static int BinarySearch(int[] a, int val)
        {
            int left = 0;
            int right = a.Length - 1;
            int mid;

            while (left < right)
            {
                mid = left + ((right - left) >> 1);
                if (val <= a[mid])
                {
                    right = mid;
                }
                else
                {
                    left = mid + 1;
                }
            }

            if (a[left] == val)
                return left;
            else
                return -1;
        }

        public static double Bisection(F f, double left, double right, double eps)
        {
            double mid;
            while (right - left > eps)
            {
                mid = left + ((right - left) / 2d);
                if (Math.Sign(f(mid)) != Math.Sign(f(left)))
                    right = mid;
                else
                    left = mid;
            }
            return (left + right) / 2d;
        }

        public static decimal TernarySearchDec(Fdec f, decimal eps, decimal l, decimal r, bool isMax)
        {
            decimal m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3m;
                m2 = r - (r - l) / 3m;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static double TernarySearch(F f, double eps, double l, double r, bool isMax)
        {
            double m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3d;
                m2 = r - (r - l) / 3d;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable<T>
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (L[i].CompareTo(R[j]) <= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R);
            Merge_Sort(A, q + 1, r, L, R);
            Merge(A, p, q, r, L, R);
        }

        static void Shake<T>(T[] a)
        {
            Random rnd = new Random(Environment.TickCount);
            T temp;
            int b, c;
            for (int i = 0; i < a.Length; i++)
            {
                b = rnd.Next(0, a.Length);
                c = rnd.Next(0, a.Length);
                temp = a[b];
                a[b] = a[c];
                a[c] = temp;
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Program
    {

        static void Main(string[] args)
        {

            string[] d1,d2,aux;

            d1 =Console.ReadLine().Split(':');
            d2 = Console.ReadLine().Split(':');

            DateTime data1 = new DateTime(int.Parse(d1[0]), int.Parse(d1[1]), int.Parse(d1[2])), data2 = new DateTime(int.Parse(d2[0]), int.Parse(d2[1]), int.Parse(d2[2]));
            if (data1 > data2)
            {
                aux = d1;
                d1 = d2;
                d2 = aux;
            }
            int aa = int.Parse(d1[0]), aa1 = int.Parse(d2[0]), dd = int.Parse(d1[2]), dd1= int.Parse(d2[2]) , mm = int.Parse(d1[1]), mm1 = int.Parse(d2[1]), difdias = 0, mesAno = 12;
            int[] numDias = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            for (; aa <= aa1; aa++)
            {
                // Console.Write("{0}/", aa);
                if ((((aa % 4) == 0 && (aa % 100) != 0) || (aa % 400) == 0))
                    numDias[1] = 29;
                else
                    numDias[1] = 29;

                if (mm == 13)
                    mm = 1;

                for (; mm <= mesAno; mm++)
                {
                    //Console.Write("{0}/{1}   dif = {2} \n", aa,mm,difdias);
                    if (aa == aa1 && mm == mm1)
                    {
                        mesAno = mm;
                        numDias[mm - 1] = dd1;
                    }
                    for (; dd <= numDias[mm - 1]; dd++)
                    {
                        //Console.Write("{0} -", dd);
                        if (aa != aa1 || mm != mm1 || dd != dd1)
                        {
                            difdias++;

                        }

                    }
                    dd = 1;
                    //Console.WriteLine("\n");
                }
            }
            Console.WriteLine(difdias);
            //Console.ReadKey();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Program
    {

        static void Main(string[] args)
        {

            string[] d1,d2,aux;

            d1 =Console.ReadLine().Split(':');
            d2 = Console.ReadLine().Split(':');

            DateTime data1 = new DateTime(int.Parse(d1[0]), int.Parse(d1[1]), int.Parse(d1[2])), data2 = new DateTime(int.Parse(d2[0]), int.Parse(d2[1]), int.Parse(d2[2]));
            if (data1 > data2)
            {
                aux = d1;
                d1 = d2;
                d2 = aux;
            }
            int aa = int.Parse(d1[0]), aa1 = int.Parse(d2[0]), dd = int.Parse(d1[2]), dd1= int.Parse(d2[2]) , mm = int.Parse(d1[1]), mm1 = int.Parse(d2[1]), difdias = 0, mesAno = 12;
            int[] numDias = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            for (; aa <= aa1; aa++)
            {
                // Console.Write("{0}/", aa);

                if (mm == 13)
                {
                    mm = 1;
                }

                for (; mm <= mesAno; mm++)
                {
                    //Console.Write("{0}/{1}   dif = {2} \n", aa,mm,difdias);
                    if (aa == aa1 && mm == mm1)
                    {
                        mesAno = mm;
                        numDias[mm - 1] = dd1;
                    }
                    for (; dd <= numDias[mm - 1]; dd++)
                    {
                        //Console.Write("{0} -", dd);
                        if (aa != aa1 || mm != mm1 || dd != dd1)
                        {
                            difdias++;
                            if (mm == 2 && dd == 28 && (((aa % 4) == 0 && (aa % 100) != 0) || (aa % 400) == 0))
                            {
                                difdias++;
                            }
                        }

                    }
                    dd = 1;
                    //Console.WriteLine("\n");
                }
            }
            Console.WriteLine(difdias);
            //Console.ReadKey();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Program
    {

        static void Main(string[] args)
        {

            string[] d1,d2;

            d1 =Console.ReadLine().Split(':');

            d2 = Console.ReadLine().Split(':');

            int aa = int.Parse(d1[0]), aa1 = int.Parse(d2[0]), dd = int.Parse(d1[2]), dd1= int.Parse(d2[2]) , mm = int.Parse(d1[1]), mm1 = int.Parse(d2[1]), difdias = 0, mesAno = 12;
            int[] numDias = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            for (; aa <= aa1; aa++)
            {
                // Console.Write("{0}/", aa);

                if (mm == 13)
                {
                    mm = 1;
                }

                for (; mm <= mesAno; mm++)
                {
                    //Console.Write("{0}/{1}   dif = {2} \n", aa,mm,difdias);
                    if (aa == aa1 && mm == mm1)
                    {
                        mesAno = mm;
                        numDias[mm - 1] = dd1;
                    }
                    for (; dd <= numDias[mm - 1]; dd++)
                    {
                        //Console.Write("{0} -", dd);
                        if (aa != aa1 || mm != mm1 || dd != dd1)
                        {
                            difdias++;
                            if (mm == 2 && dd == 28 && (((aa % 4) == 0 && (aa % 100) != 0) || (aa % 400) == 0))
                            {
                                difdias++;
                            }
                        }

                    }
                    dd = 1;
                    //Console.WriteLine("\n");
                }
            }
            Console.WriteLine(difdias);
            //Console.ReadKey();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace ConsoleApplication30
{
    internal class Program
    {
        private static void Main(string[] args)
        {
//            string[] firstDate = Console.ReadLine().Split(new string[] {":"}, StringSplitOptions.RemoveEmptyEntries);
//            string[] secondDate = Console.ReadLine().Split(new string[] {":"}, StringSplitOptions.RemoveEmptyEntries);

            string[] firstDate = new string[] {"1900", "01", "01"};
            string[] secondDate = new string[] {"2038", "12", "31"};

            DateTime dateTimeFirst = DateTime.Parse("1996,03,09");
            DateTime dateTimeSecond = DateTime.Parse("1991,11,12");
            Console.WriteLine(Math.Abs((dateTimeSecond - dateTimeFirst).TotalDays));

            Console.ReadLine();
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static void Read(out int n1, out int n2)
        {
            string[] input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
        }

        private static void Read(out int n1, out int n2, out int n3)
        {
            string[] input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
            n3 = int.Parse(input[2]);
        }

        private static void Read(out int n1, out int n2, out int n3, out int n4)
        {
            string[] input = ReadArray();
            n1 = int.Parse(input[0]);
            n2 = int.Parse(input[1]);
            n3 = int.Parse(input[2]);
            n4 = int.Parse(input[3]);
        }

        private static void Read<T>(out T a1, out T a2)
        {
            string[] input = ReadArray();
            a1 = (T) Convert.ChangeType(input[0], typeof (T));
            a2 = (T) Convert.ChangeType(input[1], typeof (T));
        }

        private static void Read<T>(out T a1, out T a2, out T a3)
        {
            string[] input = ReadArray();
            a1 = (T) Convert.ChangeType(input[0], typeof (T));
            a2 = (T) Convert.ChangeType(input[1], typeof (T));
            a3 = (T) Convert.ChangeType(input[2], typeof (T));
        }

        private static void Read<T>(out T a1, out T a2, out T a3, out T a4)
        {
            string[] input = ReadArray();
            a1 = (T) Convert.ChangeType(input[0], typeof (T));
            a2 = (T) Convert.ChangeType(input[1], typeof (T));
            a3 = (T) Convert.ChangeType(input[2], typeof (T));
            a4 = (T) Convert.ChangeType(input[3], typeof (T));
        }

        private static int ReadInt()
        {
            return Int32.Parse(Read());
        }

        private static long ReadLong()
        {
            return long.Parse(Read());
        }

        private static double ReadDouble()
        {
            return double.Parse(Read(), CultureInfo.InvariantCulture);
        }

        private static T Read<T>()
        {
            return (T) Convert.ChangeType(Read(), typeof (T));
        }

        private static string[] ReadArray()
        {
            string readLine = Console.ReadLine();
            if (readLine != null)
                return readLine.Split(' ');

            throw new ArgumentException();
        }

        private static List<int> ReadIntArray()
        {
            return ReadArray().Select(Int32.Parse).ToList();
        }

        private static List<long> ReadLongArray()
        {
            return ReadArray().Select(long.Parse).ToList();
        }

        private static List<double> ReadDoubleArray()
        {
            return ReadArray().Select(d => double.Parse(d, CultureInfo.InvariantCulture)).ToList();
        }

        private static List<T> ReadArray<T>()
        {
            return ReadArray().Select(x => (T) Convert.ChangeType(x, typeof (T))).ToList();
        }

        private static void WriteLine(int value)
        {
            Console.WriteLine(value);
        }

        private static void WriteLine(double value)
        {
            Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));
        }

        private static void WriteLine(long value)
        {
            Console.WriteLine(value);
        }

        private static void WriteLine(double value, string stringFormat)
        {
            Console.WriteLine(value.ToString(stringFormat, CultureInfo.InvariantCulture));
        }

        private static void WriteLine<T>(T value)
        {
            Console.WriteLine(value);
        }

        private static void Write(int value)
        {
            Console.Write(value);
        }

        private static void Write(double value)
        {
            Console.Write(value.ToString(CultureInfo.InvariantCulture));
        }

        private static void Write(long value)
        {
            Console.Write(value);
        }

        private static void Write(double value, string stringFormat)
        {
            Console.Write(value.ToString(stringFormat, CultureInfo.InvariantCulture));
        }

        private static void Write<T>(T value)
        {
            Console.Write(value);
        }

        #endregion
    }
}

using System;

namespace Codeforce {
    class Program {
        static void Main() {
            var date1 = Console.ReadLine().Split(':');
            var date2 = Console.ReadLine().Split(':');

            var dt1 = new DateTime(int.Parse(date1[0]), int.Parse(date1[1]), int.Parse(date1[2]));
            var dt2 = new DateTime(int.Parse(date2[0]), int.Parse(date2[1]), int.Parse(date2[2]));

            Console.WriteLine((dt2 - dt1).Days.ToString());
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class A
    {
        public void Run()
        {
            //int n = int.Parse(Console.ReadLine());
            //int[] m = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            //string str = Console.ReadLine();

        }
    }
    class B
    {

        public void Run()
        {
            //int[] m = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            int[] str = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();
            int[] str2 = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();

            DateTime d1 = new DateTime(str[0], str[1], str[2]);
            DateTime d2 = new DateTime(str2[0], str2[1], str2[2]);

            TimeSpan ts = d2 - d1;

            Console.WriteLine(ts.Days);
        }
    }

    class Programm
    {
        static void Main(string[] args)
        {
            B a = new B();
            a.Run();
        }
    }
}