import Foundation

let s = readLine()!
var c = s.count
var ans = 0
for i in (2...c).reversed() {
  if i % 2 != 0 { continue }
  let strl = s.prefix(i / 2)
  let l = s.index(s.startIndex, offsetBy: i / 2)
  let r = s.index(s.startIndex, offsetBy: i)
  let strr = s[l..<r]
  if strl == strr && i != s.count{
    ans = i
    break
  }
}
print(ans)
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/Swift/Source_1360/llvm_O3.ll'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/Swift/Source_1360/llvm_O3.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%TSS = type <{ %Ts11_StringGutsV }>
%Ts11_StringGutsV = type <{ %Ts13_StringObjectV }>
%Ts13_StringObjectV = type <{ %Ts6UInt64V, %swift.bridge* }>
%Ts6UInt64V = type <{ i64 }>
%swift.bridge = type opaque
%TSi = type <{ i64 }>
%swift.type_descriptor = type opaque
%swift.type = type { i64 }
%swift.refcounted = type { %swift.type*, i64 }
%Ts28__ContiguousArrayStorageBaseC = type <{ %swift.refcounted, %Ts10_ArrayBodyV }>
%Ts10_ArrayBodyV = type <{ %TSo22_SwiftArrayBodyStorageV }>
%TSo22_SwiftArrayBodyStorageV = type <{ %TSi, %TSu }>
%TSu = type <{ i64 }>

@"$s7llvm_O31sSSvp" = hidden local_unnamed_addr global %TSS zeroinitializer, align 8
@"$s7llvm_O31cSivp" = hidden global %TSi zeroinitializer, align 8
@"$s7llvm_O33ansSivp" = hidden global %TSi zeroinitializer, align 8
@"$ss23_ContiguousArrayStorageCMn" = external global %swift.type_descriptor, align 4
@"got.$ss23_ContiguousArrayStorageCMn" = private unnamed_addr constant %swift.type_descriptor* @"$ss23_ContiguousArrayStorageCMn"
@"symbolic _____yypG s23_ContiguousArrayStorageC" = linkonce_odr hidden constant <{ i8, i32, [4 x i8], i8 }> <{ i8 2, i32 trunc (i64 sub (i64 ptrtoint (%swift.type_descriptor** @"got.$ss23_ContiguousArrayStorageCMn" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i8, i32, [4 x i8], i8 }>, <{ i8, i32, [4 x i8], i8 }>* @"symbolic _____yypG s23_ContiguousArrayStorageC", i32 0, i32 1) to i64)) to i32), [4 x i8] c"yypG", i8 0 }>, section "swift5_typeref", no_sanitize_address, align 2
@"$ss23_ContiguousArrayStorageCyypGMD" = linkonce_odr hidden global { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (<{ i8, i32, [4 x i8], i8 }>* @"symbolic _____yypG s23_ContiguousArrayStorageC" to i64), i64 ptrtoint ({ i32, i32 }* @"$ss23_ContiguousArrayStorageCyypGMD" to i64)) to i32), i32 -9 }, align 8
@"$sSiN" = external global %swift.type, align 8
@"\01l_entry_point" = private constant { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (i32 (i32, i8**)* @main to i64), i64 ptrtoint ({ i32, i32 }* @"\01l_entry_point" to i64)) to i32), i32 0 }, section "swift5_entry", align 4
@__swift_reflection_version = linkonce_odr hidden constant i16 3
@_swift1_autolink_entries = private constant [172 x i8] c"-lFoundation\00-lswiftCore\00-lswift_StringProcessing\00-lswift_RegexParser\00-lswift_Concurrency\00-lswiftGlibc\00-lm\00-lpthread\00-lutil\00-ldl\00-lswiftDispatch\00-ldispatch\00-lBlocksRuntime\00", section ".swift1_autolink_entries", no_sanitize_address, align 8
@llvm.compiler.used = appending global [4 x i8*] [i8* bitcast ({ i32, i32 }* @"\01l_entry_point" to i8*), i8* bitcast (i16* @__swift_reflection_version to i8*), i8* getelementptr inbounds ([172 x i8], [172 x i8]* @_swift1_autolink_entries, i32 0, i32 0), i8* bitcast (i32 (i32, i8**)* @main to i8*)], section "llvm.metadata"

define protected i32 @main(i32 %0, i8** nocapture readnone %1) #0 {
entry:
  %access-scratch = alloca [24 x i8], align 8
  %access-scratch1 = alloca [24 x i8], align 8
  %access-scratch7 = alloca [24 x i8], align 8
  %2 = tail call swiftcc { i64, i64 } @"$ss8readLine16strippingNewlineSSSgSb_tF"(i1 true)
  %3 = extractvalue { i64, i64 } %2, 1
  %4 = icmp eq i64 %3, 0
  br i1 %4, label %92, label %5

5:                                                ; preds = %entry
  %6 = extractvalue { i64, i64 } %2, 0
  %7 = inttoptr i64 %3 to %swift.bridge*
  store i64 %6, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O31sSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  store %swift.bridge* %7, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O31sSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %8 = tail call swiftcc i64 @"$sSS5countSivg"(i64 %6, %swift.bridge* nonnull %7)
  store i64 %8, i64* getelementptr inbounds (%TSi, %TSi* @"$s7llvm_O31cSivp", i64 0, i32 0), align 8
  store i64 0, i64* getelementptr inbounds (%TSi, %TSi* @"$s7llvm_O33ansSivp", i64 0, i32 0), align 8
  %9 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch, i64 0, i64 0
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %9)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSi* @"$s7llvm_O31cSivp" to i8*), [24 x i8]* nonnull %access-scratch, i64 0, i8* null) #3
  %10 = load i64, i64* getelementptr inbounds (%TSi, %TSi* @"$s7llvm_O31cSivp", i64 0, i32 0), align 8
  %11 = icmp slt i64 %10, 2
  br i1 %11, label %93, label %.preheader, !prof !6

.sink.split:                                      ; preds = %76, %74
  call void @swift_bridgeObjectRelease(%swift.bridge* %49) #3
  call void @swift_bridgeObjectRelease(%swift.bridge* %62) #3
  br label %12

12:                                               ; preds = %.sink.split, %20
  %13 = icmp eq i64 %.sroa.0.0, 2
  br i1 %13, label %.loopexit, label %.preheader, !prof !6

.preheader:                                       ; preds = %5, %12
  %14 = phi i64 [ %.sroa.0.0, %12 ], [ 0, %5 ]
  %15 = phi i1 [ false, %12 ], [ true, %5 ]
  br i1 %15, label %20, label %16

16:                                               ; preds = %.preheader
  %17 = icmp slt i64 %14, 3
  br i1 %17, label %96, label %18, !prof !6

18:                                               ; preds = %16
  %19 = add nsw i64 %14, -1
  br label %20

20:                                               ; preds = %18, %.preheader
  %.sroa.0.0 = phi i64 [ %19, %18 ], [ %10, %.preheader ]
  %21 = and i64 %.sroa.0.0, 1
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %12

23:                                               ; preds = %20
  %24 = icmp slt i64 %.sroa.0.0, -1
  br i1 %24, label %94, label %25, !prof !6

25:                                               ; preds = %23
  %26 = lshr i64 %.sroa.0.0, 1
  %27 = load %swift.bridge*, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O31sSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %28 = load i64, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O31sSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  %29 = ptrtoint %swift.bridge* %27 to i64
  %30 = and i64 %29, 2305843009213693952
  %31 = icmp eq i64 %30, 0
  %32 = lshr i64 %29, 56
  %33 = and i64 %32, 15
  %34 = select i1 %31, i64 %28, i64 %33
  %35 = shl i64 %34, 16
  %36 = and i64 %29, 1152921504606846976
  %37 = icmp ne i64 %36, 0
  %38 = and i64 %28, 576460752303423488
  %39 = icmp eq i64 %38, 0
  %or.cond = select i1 %37, i1 %39, i1 false
  %.v = select i1 %or.cond, i64 11, i64 7
  %40 = or i64 %35, %.v
  %41 = call %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned %27) #3
  %42 = call swiftcc { i64, i8 } @"$sSS5index_8offsetBy07limitedC0SS5IndexVSgAE_SiAEtF"(i64 15, i64 %26, i64 %40, i64 %28, %swift.bridge* %27)
  %43 = extractvalue { i64, i8 } %42, 0
  %44 = extractvalue { i64, i8 } %42, 1
  %45 = and i8 %44, 1
  %.not = icmp eq i8 %45, 0
  %46 = select i1 %.not, i64 %43, i64 %40
  %47 = call swiftcc { i64, i64, i64, %swift.bridge* } @"$sSSySsSnySS5IndexVGcig"(i64 15, i64 %46, i64 %28, %swift.bridge* %27)
  call void @swift_bridgeObjectRelease(%swift.bridge* %27) #3
  %48 = extractvalue { i64, i64, i64, %swift.bridge* } %47, 2
  %49 = extractvalue { i64, i64, i64, %swift.bridge* } %47, 3
  %50 = load i64, i64* getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O31sSSvp", i64 0, i32 0, i32 0, i32 0, i32 0), align 8
  %51 = load %swift.bridge*, %swift.bridge** getelementptr inbounds (%TSS, %TSS* @"$s7llvm_O31sSSvp", i64 0, i32 0, i32 0, i32 1), align 8
  %52 = call swiftcc i64 @"$sSS5index_8offsetBySS5IndexVAD_SitF"(i64 15, i64 %26, i64 %50, %swift.bridge* %51)
  %53 = call swiftcc i64 @"$sSS5index_8offsetBySS5IndexVAD_SitF"(i64 15, i64 %.sroa.0.0, i64 %50, %swift.bridge* %51)
  %54 = lshr i64 %53, 14
  %55 = lshr i64 %52, 14
  %56 = icmp ult i64 %54, %55
  br i1 %56, label %95, label %57, !prof !6

57:                                               ; preds = %25
  %58 = extractvalue { i64, i64, i64, %swift.bridge* } %47, 1
  %59 = extractvalue { i64, i64, i64, %swift.bridge* } %47, 0
  %60 = call swiftcc { i64, i64, i64, %swift.bridge* } @"$sSSySsSnySS5IndexVGcig"(i64 %52, i64 %53, i64 %50, %swift.bridge* %51)
  %61 = extractvalue { i64, i64, i64, %swift.bridge* } %60, 2
  %62 = extractvalue { i64, i64, i64, %swift.bridge* } %60, 3
  %63 = extractvalue { i64, i64, i64, %swift.bridge* } %60, 1
  %64 = extractvalue { i64, i64, i64, %swift.bridge* } %60, 0
  %65 = lshr i64 %59, 16
  %66 = lshr i64 %58, 16
  %67 = lshr i64 %64, 16
  %68 = lshr i64 %63, 16
  %69 = icmp eq i64 %48, %61
  br i1 %69, label %70, label %74

70:                                               ; preds = %57
  %71 = icmp eq %swift.bridge* %49, %62
  %72 = icmp eq i64 %65, %67
  %or.cond30 = select i1 %71, i1 %72, i1 false
  %73 = icmp eq i64 %66, %68
  %or.cond31 = select i1 %or.cond30, i1 %73, i1 false
  br i1 %or.cond31, label %76, label %74

74:                                               ; preds = %70, %57
  %75 = call swiftcc i1 @"$ss22_stringCompareInternal____9expectingSbs11_StringGutsV_SnySiGAdEs01_E16ComparisonResultOtF"(i64 %48, %swift.bridge* %49, i64 %65, i64 %66, i64 %61, %swift.bridge* %62, i64 %67, i64 %68, i8 0)
  br i1 %75, label %76, label %.sink.split

76:                                               ; preds = %70, %74
  %77 = call swiftcc i64 @"$sSS5countSivg"(i64 %50, %swift.bridge* %51)
  %78 = icmp eq i64 %.sroa.0.0, %77
  br i1 %78, label %.sink.split, label %79

79:                                               ; preds = %76
  %80 = extractvalue { i64, i64, i64, %swift.bridge* } %47, 3
  %81 = extractvalue { i64, i64, i64, %swift.bridge* } %60, 3
  %82 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch7, i64 0, i64 0
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %82)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSi* @"$s7llvm_O33ansSivp" to i8*), [24 x i8]* nonnull %access-scratch7, i64 1, i8* null) #3
  store i64 %.sroa.0.0, i64* getelementptr inbounds (%TSi, %TSi* @"$s7llvm_O33ansSivp", i64 0, i32 0), align 8
  call void @swift_bridgeObjectRelease(%swift.bridge* %80) #3
  call void @swift_bridgeObjectRelease(%swift.bridge* %81) #3
  br label %.loopexit

.loopexit:                                        ; preds = %12, %79
  %83 = call %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* nonnull @"$ss23_ContiguousArrayStorageCyypGMD") #6
  %84 = call noalias %swift.refcounted* @swift_allocObject(%swift.type* %83, i64 64, i64 7) #3
  %85 = bitcast %swift.refcounted* %84 to %Ts28__ContiguousArrayStorageBaseC*
  %86 = getelementptr inbounds %swift.refcounted, %swift.refcounted* %84, i64 1
  %._storage.count._value = bitcast %swift.refcounted* %86 to i64*
  store i64 1, i64* %._storage.count._value, align 8
  %._storage._capacityAndFlags = getelementptr inbounds %swift.refcounted, %swift.refcounted* %84, i64 1, i32 1
  store i64 2, i64* %._storage._capacityAndFlags, align 8
  %87 = getelementptr inbounds %swift.refcounted, %swift.refcounted* %84, i64 2
  %88 = getelementptr inbounds [24 x i8], [24 x i8]* %access-scratch1, i64 0, i64 0
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %88)
  call void @swift_beginAccess(i8* nonnull bitcast (%TSi* @"$s7llvm_O33ansSivp" to i8*), [24 x i8]* nonnull %access-scratch1, i64 0, i8* null) #3
  %89 = load i64, i64* getelementptr inbounds (%TSi, %TSi* @"$s7llvm_O33ansSivp", i64 0, i32 0), align 8
  %90 = getelementptr inbounds %swift.refcounted, %swift.refcounted* %84, i64 3, i32 1
  %91 = bitcast i64* %90 to %swift.type**
  store %swift.type* @"$sSiN", %swift.type** %91, align 8
  %._value2 = bitcast %swift.refcounted* %87 to i64*
  store i64 %89, i64* %._value2, align 8
  call swiftcc void @"$ss5print_9separator10terminatoryypd_S2StF"(%Ts28__ContiguousArrayStorageBaseC* %85, i64 32, %swift.bridge* nonnull inttoptr (i64 -2233785415175766016 to %swift.bridge*), i64 10, %swift.bridge* nonnull inttoptr (i64 -2233785415175766016 to %swift.bridge*))
  call void @swift_release(%swift.refcounted* %84) #3
  ret i32 0

92:                                               ; preds = %entry
  tail call void asm sideeffect "", "n"(i32 0) #3
  tail call void @llvm.trap()
  unreachable

93:                                               ; preds = %5
  call void asm sideeffect "", "n"(i32 1) #3
  call void @llvm.trap()
  unreachable

94:                                               ; preds = %23
  call void asm sideeffect "", "n"(i32 3) #3
  call void @llvm.trap()
  unreachable

95:                                               ; preds = %25
  call void asm sideeffect "", "n"(i32 4) #3
  call void @llvm.trap()
  unreachable

96:                                               ; preds = %16
  call void asm sideeffect "", "n"(i32 5) #3
  call void @llvm.trap()
  unreachable
}

declare swiftcc { i64, i64 } @"$ss8readLine16strippingNewlineSSSgSb_tF"(i1) local_unnamed_addr #0

; Function Attrs: cold noreturn nounwind
declare void @llvm.trap() #1

declare swiftcc i64 @"$sSS5countSivg"(i64, %swift.bridge*) local_unnamed_addr #0

; Function Attrs: argmemonly mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2

; Function Attrs: nounwind
declare void @swift_beginAccess(i8*, [24 x i8]*, i64, i8*) local_unnamed_addr #3

; Function Attrs: mustprogress nofree noinline nounwind readonly willreturn
define linkonce_odr hidden %swift.type* @__swift_instantiateConcreteTypeFromMangledName({ i32, i32 }* %0) local_unnamed_addr #4 {
entry:
  %1 = bitcast { i32, i32 }* %0 to i64*
  %2 = load atomic i64, i64* %1 monotonic, align 8
  %3 = icmp slt i64 %2, 0
  br i1 %3, label %7, label %4, !prof !6

4:                                                ; preds = %7, %entry
  %5 = phi i64 [ %2, %entry ], [ %15, %7 ]
  %6 = inttoptr i64 %5 to %swift.type*
  ret %swift.type* %6

7:                                                ; preds = %entry
  %8 = ashr i64 %2, 32
  %9 = sub nsw i64 0, %8
  %sext = shl i64 %2, 32
  %10 = ashr exact i64 %sext, 32
  %11 = ptrtoint { i32, i32 }* %0 to i64
  %12 = add i64 %10, %11
  %13 = inttoptr i64 %12 to i8*
  %14 = tail call swiftcc %swift.type* @swift_getTypeByMangledNameInContext2(i8* %13, i64 %9, %swift.type_descriptor* null, i8** null) #7
  %15 = ptrtoint %swift.type* %14 to i64
  store atomic i64 %15, i64* %1 monotonic, align 8
  br label %4
}

; Function Attrs: argmemonly nounwind
declare swiftcc %swift.type* @swift_getTypeByMangledNameInContext2(i8*, i64, %swift.type_descriptor*, i8**) local_unnamed_addr #5

; Function Attrs: nounwind
declare %swift.refcounted* @swift_allocObject(%swift.type*, i64, i64) local_unnamed_addr #3

declare swiftcc void @"$ss5print_9separator10terminatoryypd_S2StF"(%Ts28__ContiguousArrayStorageBaseC*, i64, %swift.bridge*, i64, %swift.bridge*) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @swift_release(%swift.refcounted*) local_unnamed_addr #3

declare swiftcc { i64, i8 } @"$sSS5index_8offsetBy07limitedC0SS5IndexVSgAE_SiAEtF"(i64, i64, i64, i64, %swift.bridge*) local_unnamed_addr #0

; Function Attrs: nounwind
declare %swift.bridge* @swift_bridgeObjectRetain(%swift.bridge* returned) local_unnamed_addr #3

declare swiftcc { i64, i64, i64, %swift.bridge* } @"$sSSySsSnySS5IndexVGcig"(i64, i64, i64, %swift.bridge*) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @swift_bridgeObjectRelease(%swift.bridge*) local_unnamed_addr #3

declare swiftcc i64 @"$sSS5index_8offsetBySS5IndexVAD_SitF"(i64, i64, i64, %swift.bridge*) local_unnamed_addr #0

declare swiftcc i1 @"$ss22_stringCompareInternal____9expectingSbs11_StringGutsV_SnySiGAdEs01_E16ComparisonResultOtF"(i64, %swift.bridge*, i64, i64, i64, %swift.bridge*, i64, i64, i8) local_unnamed_addr #0

attributes #0 = { "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { cold noreturn nounwind }
attributes #2 = { argmemonly mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { nounwind }
attributes #4 = { mustprogress nofree noinline nounwind readonly willreturn "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { argmemonly nounwind }
attributes #6 = { nounwind readonly }
attributes #7 = { argmemonly nounwind readonly }

!swift.module.flags = !{!0}
!llvm.linker.options = !{}
!llvm.module.flags = !{!1, !2, !3, !4, !5}

!0 = !{!"standard-library", i1 false}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 8, !"PIC Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{i32 4, !"Objective-C Garbage Collection", i32 84477696}
!5 = !{i32 1, !"Swift Version", i32 7}
!6 = !{!"branch_weights", i32 1, i32 2000}
