#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 /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main() {
  char number[20];
  int count, lcount = 0;
  scanf("%s", number);
  for (count = 0; number[count] != '\0'; count++)
    if (number[count] == '7' || number[count] == '4')
      lcount++;
  sprintf(number, "%d", lcount);
  for (count = 0; number[count] != '\0'; count++) {
    if (!(number[count] == '7' || number[count] == '4')) {
      printf("NO");
      return 0;
    }
  }
  printf("YES");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11af <main+0x7f>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x37,%eax
je     1193 <main+0x63>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x34,%eax
jne    119c <main+0x6c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11a1 <main+0x71>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115d <main+0x2d>
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%edx
lea    0xe46(%rip),%rsi
call   1050 <sprintf@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     122a <main+0xfa>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x37,%eax
je     1217 <main+0xe7>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x34,%eax
je     1217 <main+0xe7>
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    123d <main+0x10d>
jmp    121c <main+0xec>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c9 <main+0x99>
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
xor    %edx,%edx
jmp    1157 <main+0x27>
nopl   0x0(%rax,%rax,1)
add    $0x1,%edx
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x34,%al
je     1150 <main+0x20>
cmp    $0x37,%al
je     1150 <main+0x20>
test   %al,%al
jne    1153 <main+0x23>
lea    0xe96(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
jmp    1184 <main+0x54>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x34,%al
je     1180 <main+0x50>
cmp    $0x37,%al
je     1180 <main+0x50>
test   %al,%al
jne    119c <main+0x6c>
lea    0xe6f(%rip),%rdi
jmp    11a3 <main+0x73>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"NO\00"
@.str.3 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %4
4: ; preds = %11, %0
%5 = phi i64 [ %13, %11 ], [ 0, %0 ]
%6 = phi i32 [ %12, %11 ], [ 0, %0 ]
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %5
%8 = load i8, i8* %7
switch i8 %8, label %11 [
i8 0, label %14
i8 55, label %9
i8 52, label %9
]
9: ; preds = %4, %4
%10 = add nsw i32 %6, 1
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ %10, %9 ], [ %6, %4 ]
%13 = add nuw i64 %5, 1
br label %4
14: ; preds = %4
%15 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %16
16: ; preds = %20, %14
%17 = phi i64 [ %21, %20 ], [ 0, %14 ]
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %17
%19 = load i8, i8* %18
switch i8 %19, label %23 [
i8 0, label %22
i8 55, label %20
i8 52, label %20
]
20: ; preds = %16, %16
%21 = add nuw i64 %17, 1
br label %16
22: ; preds = %16
br label %23
23: ; preds = %16, %22
%24 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %22 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %16 ]
%25 = call i32 @printf(i8* dereferenceable(1) %24)
ret i32 0
}