#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 */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  int t, count = 0, i, j, k, l1, l2;
  char a[10000], b[10000];
  {
    scanf("%s", a);
    l1 = strlen(a);
    scanf("%s", b);
    l2 = strlen(b);
    {
      for (j = 0; j < l1; j++) {
        for (k = 0; k < l2; k++) {
          if (a[j] == b[k]) {
            b[k] = 1;
            count++;
            break;
          }
        }
      }
      printf("%d\n", l1 + l2 - 2 * count);
      count = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x2730(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x2730(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x4e40(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x4e40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1213 <main+0xe3>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1200 <main+0xd0>
movslq -0x14(%rbp),%rax
movsbl -0x2730(%rbp,%rax,1),%eax
ff
movslq -0x18(%rbp),%rcx
movsbl -0x4e40(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    11ed <main+0xbd>
movslq -0x18(%rbp),%rax
movb   $0x1,-0x4e40(%rbp,%rax,1)
01
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1200 <main+0xd0>
jmp    11f2 <main+0xc2>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a7 <main+0x77>
jmp    1205 <main+0xd5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <main+0x64>
mov    -0x1c(%rbp),%esi
add    -0x20(%rbp),%esi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    %eax,%esi
lea    0xddb(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
add    $0x4e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x4e20,%rsp
lea    0xebe(%rip),%rbx
lea    0x2710(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %eax,%r14d
mov    %rsp,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
test   %r14d,%r14d
jle    11c0 <main+0x90>
mov    %r14d,%edx
mov    %eax,%esi
xor    %edi,%edi
xor    %ecx,%ecx
jmp    11a0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
movb   $0x1,(%rsp,%rbp,1)
add    $0x1,%ecx
add    $0x1,%rdi
cmp    %rdx,%rdi
je     11c2 <main+0x92>
test   %eax,%eax
jle    1197 <main+0x67>
mov    0x2710(%rsp,%rdi,1),%bl
xor    %ebp,%ebp
nopl   (%rax)
cmp    (%rsp,%rbp,1),%bl
je     1190 <main+0x60>
add    $0x1,%rbp
cmp    %rbp,%rsi
jne    11b0 <main+0x80>
jmp    1197 <main+0x67>
xor    %ecx,%ecx
add    %r14d,%eax
add    %ecx,%ecx
sub    %ecx,%eax
lea    0xe33(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x4e20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [10000 x i8]
%10 = alloca [10000 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
%11 = getelementptr inbounds [10000 x i8], [10000 x i8]* %9, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [10000 x i8], [10000 x i8]* %9, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
store i32 %14, i32* %7
%15 = getelementptr inbounds [10000 x i8], [10000 x i8]* %10, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [10000 x i8], [10000 x i8]* %10, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
store i32 %18, i32* %8
store i32 0, i32* %5
br label %19
19: ; preds = %51, %0
%20 = load i32, i32* %5
%21 = load i32, i32* %7
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %54
23: ; preds = %19
store i32 0, i32* %6
br label %24
24: ; preds = %47, %23
%25 = load i32, i32* %6
%26 = load i32, i32* %8
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %50
28: ; preds = %24
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10000 x i8], [10000 x i8]* %9, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10000 x i8], [10000 x i8]* %10, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %33, %38
br i1 %39, label %40, label %46
40: ; preds = %28
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [10000 x i8], [10000 x i8]* %10, i64 0, i64 %42
store i8 1, i8* %43
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %50
46: ; preds = %28
br label %47
47: ; preds = %46
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
br label %24
50: ; preds = %40, %24
br label %51
51: ; preds = %50
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %19
54: ; preds = %19
%55 = load i32, i32* %7
%56 = load i32, i32* %8
%57 = add nsw i32 %55, %56
%58 = load i32, i32* %3
%59 = mul nsw i32 2, %58
%60 = sub nsw i32 %57, %59
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %60)
store i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = alloca [10000 x i8]
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @strlen(i8* %4)
%9 = icmp sgt i32 %6, 0
br i1 %9, label %10, label %36
10: ; preds = %0
%11 = icmp sgt i32 %8, 0
%12 = zext i32 %6 to i64
%13 = zext i32 %8 to i64
br label %14
14: ; preds = %10, %32
%15 = phi i64 [ 0, %10 ], [ %34, %32 ]
%16 = phi i32 [ 0, %10 ], [ %33, %32 ]
br i1 %11, label %17, label %32
17: ; preds = %14
%18 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 %15
%19 = load i8, i8* %18
br label %20
20: ; preds = %17, %29
%21 = phi i64 [ 0, %17 ], [ %30, %29 ]
%22 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %19, %23
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = and i64 %21, 4294967295
%27 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 %26
store i8 1, i8* %27
%28 = add nsw i32 %16, 1
br label %32
29: ; preds = %20
%30 = add nuw nsw i64 %21, 1
%31 = icmp eq i64 %30, %13
br i1 %31, label %32, label %20
32: ; preds = %29, %14, %25
%33 = phi i32 [ %28, %25 ], [ %16, %14 ], [ %16, %29 ]
%34 = add nuw nsw i64 %15, 1
%35 = icmp eq i64 %34, %12
br i1 %35, label %36, label %14
36: ; preds = %32, %0
%37 = phi i32 [ 0, %0 ], [ %33, %32 ]
%38 = add nsw i32 %8, %6
%39 = mul i32 %37, -2
%40 = add i32 %38, %39
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
ret i32 0
}