# https://velog.io/@devjuun_s/%EB%AC%B8%EC%9E%90%EC%97%B4-%EC%95%95%EC%B6%95-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4python2020-Kakao-%EA%B3%B5%EC%B1%84
def solution(s):
    length = []
    result = ""

    if len(s) == 1:
        return 1
    for cut in range(1,len(s)//2 + 1):
        count  = 1
        tempStr = s[:cut]
        for i in range(cut,len(s),cut):
            if s[i:i+cut] == tempStr:
                count+=1
            else:
                #그냥 1인 값은 무시해야 하므로
                if count == 1:
                    count = ""
                result += str(count) + tempStr
                tempStr = s[i:i+cut]
                count = 1
        if counr == 1:
            count = ""
        result += str(count)+tempStr
        length.append(len(result))
        result = ""
                
    return min(length)
