#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 *, int *);
int main() {
  int k, l, m, n, d, i, count = 0;
  scanf("%d", &k);
  scanf("%d", &l);
  scanf("%d", &m);
  scanf("%d", &n);
  scanf("%d", &d);
  for (i = 1; i <= d; i++) {
    if (i % k == 0)
      count++;
    else if (i % l == 0)
      count++;
    else if (i % m == 0)
      count++;
    else if (i % n == 0)
      count++;
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe93(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe83(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     122e <main+0x10e>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11b7 <main+0x97>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    121b <main+0xfb>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11d5 <main+0xb5>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1216 <main+0xf6>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11f3 <main+0xd3>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1211 <main+0xf1>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    120c <main+0xec>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1211 <main+0xf1>
jmp    1216 <main+0xf6>
jmp    121b <main+0xfb>
jmp    1220 <main+0x100>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118d <main+0x6d>
mov    -0x20(%rbp),%esi
lea    0xdcb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    11eb <main+0xcb>
mov    0x1c(%rsp),%ebx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    0x10(%rsp),%r10d
neg    %edi
mov    $0x1,%ecx
xor    %esi,%esi
jmp    11b0 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %eax,%esi
lea    (%rdi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
je     11ed <main+0xcd>
mov    %ecx,%eax
cltd
idiv   %ebx
mov    $0x1,%eax
test   %edx,%edx
je     11a0 <main+0x80>
mov    %ecx,%eax
cltd
idiv   %r8d
mov    $0x1,%eax
test   %edx,%edx
je     11a0 <main+0x80>
mov    %ecx,%eax
cltd
idiv   %r9d
mov    $0x1,%eax
test   %edx,%edx
je     11a0 <main+0x80>
mov    %ecx,%eax
cltd
idiv   %r10d
xor    %eax,%eax
test   %edx,%edx
sete   %al
jmp    11a0 <main+0x80>
xor    %esi,%esi
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 1
br i1 %17, label %43, label %18
18: ; preds = %0
%19 = load i32, i32* %1
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %4
br label %23
23: ; preds = %18, %38
%24 = phi i32 [ 0, %18 ], [ %40, %38 ]
%25 = phi i32 [ 1, %18 ], [ %41, %38 ]
%26 = srem i32 %25, %19
%27 = icmp eq i32 %26, 0
br i1 %27, label %38, label %28
28: ; preds = %23
%29 = srem i32 %25, %20
%30 = icmp eq i32 %29, 0
br i1 %30, label %38, label %31
31: ; preds = %28
%32 = srem i32 %25, %21
%33 = icmp eq i32 %32, 0
br i1 %33, label %38, label %34
34: ; preds = %31
%35 = srem i32 %25, %22
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
br label %38
38: ; preds = %31, %28, %23, %34
%39 = phi i32 [ %37, %34 ], [ 1, %23 ], [ 1, %28 ], [ 1, %31 ]
%40 = add nuw nsw i32 %24, %39
%41 = add nuw i32 %25, 1
%42 = icmp eq i32 %25, %16
br i1 %42, label %43, label %23
43: ; preds = %38, %0
%44 = phi i32 [ 0, %0 ], [ %40, %38 ]
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
ret i32 0
}