s = input()
variants = []
for i in range(len(s)):
variants.append(s[i:])
for j in range(1, len(s) - i):
variants.append(s[i:-j])
unique_variants = []
for variant in variants:
if variant not in unique_variants:
unique_variants.append(variant)
print(len(unique_variants))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
s = input()
variants = []
for i in range(len(s)):
variants.append(s[i:])
for j in range(1, len(s) - i):
variants.append(s[i:-j])
unique_variants = []
for variant in variants:
if variant not in unique_variants:
unique_variants.append(variant)
print(len(unique_variants))