#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);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sort_by_freeqence(int **);
int main() {
  char input[1000];
  int meet_times[26][2];
  int counter;
  scanf("%[^\n]s", input);
  for (counter = 0; counter < 26; counter++) {
    meet_times[counter][0] = counter;
    meet_times[counter][1] = 0;
  }
  counter = 0;
  while (input[counter] != '\0') {
    if (input[counter] >= 'a' && input[counter] <= 'z') {
      meet_times[input[counter] - 'a'][1]++;
    } else if (input[counter] >= 'A' && input[counter] <= 'Z') {
      meet_times[input[counter] - 'A'][1]++;
    }
    counter++;
  }
  sort_by_freeqence(meet_times);
  for (counter = 0; counter < 26; counter++) {
    printf("%c: %d\n", meet_times[counter][0] + 'a', meet_times[counter][1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x4c4(%rbp)
cmpl   $0x1a,-0x4c4(%rbp)
jge    11a6 <main+0x76>
mov    -0x4c4(%rbp),%ecx
movslq -0x4c4(%rbp),%rax
mov    %ecx,-0x4c0(%rbp,%rax,8)
movslq -0x4c4(%rbp),%rax
movl   $0x0,-0x4bc(%rbp,%rax,8)
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    115f <main+0x2f>
movl   $0x0,-0x4c4(%rbp)
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1290 <main+0x160>
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     1222 <main+0xf2>
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     1222 <main+0xf2>
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x61,%eax
cltq
mov    -0x4bc(%rbp,%rax,8),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4bc(%rbp,%rax,8)
jmp    127c <main+0x14c>
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x41,%eax
jl     1277 <main+0x147>
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jg     1277 <main+0x147>
movslq -0x4c4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x41,%eax
cltq
mov    -0x4bc(%rbp,%rax,8),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4bc(%rbp,%rax,8)
jmp    127c <main+0x14c>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    11b0 <main+0x80>
lea    -0x4c0(%rbp),%rdi
call   1040 <sort_by_freeqence@plt>
movl   $0x0,-0x4c4(%rbp)
cmpl   $0x1a,-0x4c4(%rbp)
jge    12f2 <main+0x1c2>
movslq -0x4c4(%rbp),%rax
mov    -0x4c0(%rbp,%rax,8),%esi
add    $0x61,%esi
movslq -0x4c4(%rbp),%rax
mov    -0x4bc(%rbp,%rax,8),%edx
lea    0xd2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    12a6 <main+0x176>
xor    %eax,%eax
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x4b8,%rsp
lea    0xf8f(%rip),%rdi
lea    0xd0(%rsp),%rsi
call   1050 <scanf@plt>
movaps 0xeab(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
mov    0xd0(%rsp),%dl
test   %dl,%dl
je     1252 <main+0x122>
mov    $0xffffff9f,%ecx
lea    0xd1(%rsp),%rax
add    $0x20,%rcx
jmp    1236 <main+0x106>
cs nopw 0x0(%rax,%rax,1)
movsbq %dl,%rdx
add    %edx,%esi
addl   $0x1,0x4(%rsp,%rsi,8)
movzbl (%rax),%edx
add    $0x1,%rax
test   %dl,%dl
je     1252 <main+0x122>
lea    -0x61(%rdx),%edi
mov    $0xffffff9f,%esi
cmp    $0x1a,%dil
jb     1220 <main+0xf0>
lea    -0x41(%rdx),%edi
mov    %rcx,%rsi
cmp    $0x19,%dil
jbe    1220 <main+0xf0>
jmp    122b <main+0xfb>
mov    %rsp,%rdi
call   1040 <sort_by_freeqence@plt>
xor    %ebx,%ebx
lea    0xe74(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsp,%rbx,8),%esi
mov    0x4(%rsp,%rbx,8),%edx
add    $0x61,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    1270 <main+0x140>
xor    %eax,%eax
add    $0x4b8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [8 x i8] c"%c: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [26 x [2 x i32]]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 0, i32* %4
br label %7
7: ; preds = %20, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 26
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 %13
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
store i32 %11, i32* %15
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 %17
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0, i64 1
store i32 0, i32* %19
br label %20
20: ; preds = %10
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %7
23: ; preds = %7
store i32 0, i32* %4
br label %24
24: ; preds = %84, %23
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %87
31: ; preds = %24
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp sge i32 %36, 97
br i1 %37, label %38, label %57
38: ; preds = %31
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp sle i32 %43, 122
br i1 %44, label %45, label %57
45: ; preds = %38
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = sub nsw i32 %50, 97
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 %52
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %53, i64 0, i64 1
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 1
store i32 %56, i32* %54
br label %84
57: ; preds = %38, %31
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp sge i32 %62, 65
br i1 %63, label %64, label %83
64: ; preds = %57
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp sle i32 %69, 90
br i1 %70, label %71, label %83
71: ; preds = %64
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = sub nsw i32 %76, 65
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 %78
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %79, i64 0, i64 1
%81 = load i32, i32* %80
%82 = add nsw i32 %81, 1
store i32 %82, i32* %80
br label %83
83: ; preds = %71, %64, %57
br label %84
84: ; preds = %83, %45
%85 = load i32, i32* %4
%86 = add nsw i32 %85, 1
store i32 %86, i32* %4
br label %24
87: ; preds = %24
%88 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 0
%89 = bitcast [2 x i32]* %88 to i32**
%90 = call i32 @sort_by_freeqence(i32** %89)
store i32 0, i32* %4
br label %91
91: ; preds = %107, %87
%92 = load i32, i32* %4
%93 = icmp slt i32 %92, 26
br i1 %93, label %94, label %110
94: ; preds = %91
%95 = load i32, i32* %4
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 %96
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %97, i64 0, i64 0
%99 = load i32, i32* %98
%100 = add nsw i32 %99, 97
%101 = load i32, i32* %4
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 %102
%104 = getelementptr inbounds [2 x i32], [2 x i32]* %103, i64 0, i64 1
%105 = load i32, i32* %104
%106 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %100, i32 %105)
br label %107
107: ; preds = %94
%108 = load i32, i32* %4
%109 = add nsw i32 %108, 1
store i32 %109, i32* %4
br label %91
110: ; preds = %91
ret i32 0
}

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