#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int atoi(char *);
scalar_t__ count_mon(int, int);
int count_year(int, int);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  freopen("input.txt", "r", stdin);
  char a[9], b[9];
  int y, m, d, Y, M, D, total;
  while (scanf("%s %s", a, b) != EOF) {
    y = atoi(a);
    Y = atoi(b);
    if (y > Y) {
      m = y, y = Y, Y = m;
    }
    d = y % 100;
    y = y / 100;
    m = y % 100;
    y = y / 100;
    D = Y % 100;
    Y = Y / 100;
    M = Y % 100;
    Y = Y / 100;
    total = count_year(y, Y);
    total += count_mon(Y, M);
    total -= count_mon(y, m);
    total += 1 + (D - d);
    printf("%d\n", total);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
lea    0xe7a(%rip),%rdi
lea    0xe7d(%rip),%rsi
call   1050 <freopen@plt>
lea    -0x19(%rbp),%rsi
lea    -0x22(%rbp),%rdx
lea    0xe6b(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e33(%rip),%rcx
cmp    (%rcx),%rax
je     12bd <main+0x15d>
lea    -0x19(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x28(%rbp)
lea    -0x22(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x34(%rbp),%eax
jle    11ec <main+0x8c>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1080 <count_year@plt>
mov    %eax,-0x40(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <count_mon@plt>
mov    %rax,%rcx
movslq -0x40(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1030 <count_mon@plt>
mov    %rax,%rcx
movslq -0x40(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
sub    -0x30(%rbp),%eax
add    $0x1,%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%esi
lea    0xd5f(%rip),%rdi
call   1040 <printf@plt>
jmp    1192 <main+0x32>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
lea    0xe82(%rip),%rdi
lea    0xe85(%rip),%rsi
call   1050 <freopen@plt>
nopw   0x0(%rax,%rax,1)
lea    0xe75(%rip),%rdi
lea    0x1f(%rsp),%rsi
lea    0x16(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x2e33(%rip),%rcx
cmp    (%rcx),%rax
je     12c2 <main+0x162>
lea    0x1f(%rsp),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
lea    0x16(%rsp),%rdi
call   1070 <atoi@plt>
cmp    %eax,%ebx
mov    %eax,%ecx
cmovg  %ebx,%ecx
cmovg  %eax,%ebx
movslq %ebx,%rax
imul   $0x51eb851f,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
imul   $0x64,%edx,%esi
imul   $0x68db8bad,%rax,%rbp
sub    %esi,%eax
mov    %eax,0x10(%rsp)
movslq %edx,%r13
imul   $0x51eb851f,%r13,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%r13d
mov    %rbp,%rax
shr    $0x3f,%rax
sar    $0x2c,%rbp
add    %eax,%ebp
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%edx
imul   $0x68db8bad,%rax,%r15
mov    %eax,%r14d
sub    %edx,%r14d
movslq %ecx,%r12
imul   $0x51eb851f,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%r12d
mov    %r15,%rax
shr    $0x3f,%rax
sar    $0x2c,%r15
add    %eax,%r15d
mov    %ebp,%edi
mov    %r15d,%esi
call   1080 <count_year@plt>
mov    %eax,0xc(%rsp)
mov    %r15d,%edi
mov    %r12d,%esi
call   1030 <count_mon@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r13d,%esi
call   1030 <count_mon@plt>
add    0xc(%rsp),%ebx
add    %r14d,%ebx
add    0x10(%rsp),%eax
sub    %eax,%ebx
add    $0x1,%ebx
lea    0xd5c(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1190 <main+0x30>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [6 x i8] c"%s %s\00"
@EOF = global i64 0
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i8]
%7 = alloca [9 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @stdin
%16 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %35, %2
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%20 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i64, i64* @EOF
%22 = icmp ne i64 %20, %21
br i1 %22, label %23, label %77
23: ; preds = %17
%24 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %8
%26 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %11
%28 = load i32, i32* %8
%29 = load i32, i32* %11
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %35
31: ; preds = %23
%32 = load i32, i32* %8
store i32 %32, i32* %9
%33 = load i32, i32* %11
store i32 %33, i32* %8
%34 = load i32, i32* %9
store i32 %34, i32* %11
br label %35
35: ; preds = %31, %23
%36 = load i32, i32* %8
%37 = srem i32 %36, 100
store i32 %37, i32* %10
%38 = load i32, i32* %8
%39 = sdiv i32 %38, 100
store i32 %39, i32* %8
%40 = load i32, i32* %8
%41 = srem i32 %40, 100
store i32 %41, i32* %9
%42 = load i32, i32* %8
%43 = sdiv i32 %42, 100
store i32 %43, i32* %8
%44 = load i32, i32* %11
%45 = srem i32 %44, 100
store i32 %45, i32* %13
%46 = load i32, i32* %11
%47 = sdiv i32 %46, 100
store i32 %47, i32* %11
%48 = load i32, i32* %11
%49 = srem i32 %48, 100
store i32 %49, i32* %12
%50 = load i32, i32* %11
%51 = sdiv i32 %50, 100
store i32 %51, i32* %11
%52 = load i32, i32* %8
%53 = load i32, i32* %11
%54 = call i32 @count_year(i32 %52, i32 %53)
store i32 %54, i32* %14
%55 = load i32, i32* %11
%56 = load i32, i32* %12
%57 = call i64 @count_mon(i32 %55, i32 %56)
%58 = load i32, i32* %14
%59 = sext i32 %58 to i64
%60 = add nsw i64 %59, %57
%61 = trunc i64 %60 to i32
store i32 %61, i32* %14
%62 = load i32, i32* %8
%63 = load i32, i32* %9
%64 = call i64 @count_mon(i32 %62, i32 %63)
%65 = load i32, i32* %14
%66 = sext i32 %65 to i64
%67 = sub nsw i64 %66, %64
%68 = trunc i64 %67 to i32
store i32 %68, i32* %14
%69 = load i32, i32* %13
%70 = load i32, i32* %10
%71 = sub nsw i32 %69, %70
%72 = add nsw i32 1, %71
%73 = load i32, i32* %14
%74 = add nsw i32 %73, %72
store i32 %74, i32* %14
%75 = load i32, i32* %14
%76 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %75)
br label %17
77: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [6 x i8] c"%s %s\00"
@EOF = global i64 0
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i8]
%4 = alloca [9 x i8]
%5 = load i32, i32* @stdin
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%9 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %40, label %12
12: ; preds = %2, %12
%13 = call i32 @atoi(i8* %7)
%14 = call i32 @atoi(i8* %8)
%15 = icmp sgt i32 %13, %14
%16 = select i1 %15, i32 %13, i32 %14
%17 = select i1 %15, i32 %14, i32 %13
%18 = srem i32 %17, 100
%19 = sdiv i32 %17, 100
%20 = srem i32 %19, 100
%21 = sdiv i32 %17, 10000
%22 = srem i32 %16, 100
%23 = sdiv i32 %16, 100
%24 = srem i32 %23, 100
%25 = sdiv i32 %16, 10000
%26 = call i32 @count_year(i32 %21, i32 %25)
%27 = call i64 @count_mon(i32 %25, i32 %24)
%28 = trunc i64 %27 to i32
%29 = call i64 @count_mon(i32 %21, i32 %20)
%30 = trunc i64 %29 to i32
%31 = add i32 %26, 1
%32 = add i32 %31, %28
%33 = add i32 %32, %22
%34 = add i32 %18, %30
%35 = sub i32 %33, %34
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8)
%38 = load i64, i64* @EOF
%39 = icmp eq i64 %37, %38
br i1 %39, label %40, label %12
40: ; preds = %12, %2
ret i32 0
}