#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, unsigned long long);
int /*<<< orphan*/ scanf(char *, char *);
unsigned long long stringFunctionCalculation(char *);
int strlen(char *);
int main() {
  char a[100001];
  memset(a, 0, 100001);
  scanf("%s", a);
  int len = strlen(a);
  unsigned long long ret = stringFunctionCalculation(a);
  if (len > ret) {
    ret = len;
  }
  printf("%llu\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x186b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x186a1,%edx
call   1060 <memset@plt>
lea    -0x186b0(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x186b0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x186b4(%rbp)
lea    -0x186b0(%rbp),%rdi
call   1030 <stringFunctionCalculation@plt>
mov    %rax,-0x186c0(%rbp)
movslq -0x186b4(%rbp),%rax
cmp    -0x186c0(%rbp),%rax
jbe    11cf <main+0x7f>
movslq -0x186b4(%rbp),%rax
mov    %rax,-0x186c0(%rbp)
mov    -0x186c0(%rbp),%rsi
lea    0xe26(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x186c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x186a8,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x186a1,%edx
call   1060 <memset@plt>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <stringFunctionCalculation@plt>
movslq %ebp,%rsi
cmp    %rsi,%rax
cmovae %rax,%rsi
lea    0xe66(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x186a8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100001 x i8]
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
%5 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 100001)
%7 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %3
%11 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%12 = call i64 @stringFunctionCalculation(i8* %11)
store i64 %12, i64* %4
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = load i64, i64* %4
%16 = icmp ugt i64 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
store i64 %19, i64* %4
br label %20
20: ; preds = %17, %0
%21 = load i64, i64* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca [100001 x i8]
%2 = getelementptr inbounds [100001 x i8], [100001 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 100001)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i64 @stringFunctionCalculation(i8* %2)
%7 = sext i32 %5 to i64
%8 = icmp ult i64 %6, %7
%9 = select i1 %8, i64 %7, i64 %6
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}