def henkan(S): S = list(S) cnvS_lists = [[S, []]] while len(cnvS_lists[0][0]) > 1: p_lists = [] for i in range(len(cnvS_lists)): bef_S1 = cnvS_lists[i][0] cnv_S1 = cnvS_lists[i][1] cnv_S2_1 = cnv_S1 + [bef_S1[0]] cnv_S2_2 = cnv_S1 + [bef_S1[-1]] bef_S2_1 = bef_S1[1:] bef_S2_2 = bef_S1[:-1] p_lists.append([bef_S2_1, cnv_S2_1]) p_lists.append([bef_S2_2, cnv_S2_2]) cnvS_lists = p_lists for j in range(len(cnvS_lists)): if cnvS_lists[j] == [0]: continue for k in range(j + 1, len(cnvS_lists)): if cnvS_lists[j] == cnvS_lists[k]: cnvS_lists[k] = [0] zero_cnt = cnvS_lists.count([0]) result = len(cnvS_lists) - zero_cnt return result def main(): S = input() print(henkan(S)) if __name__ == '__main__': main()