import numpy as np def main(): s = input() aa = np.array([1, 0, 0]) bb = np.array([0, 1, 0]) cc = np.array([0, 0, 1]) x = np.array([1, np.sqrt(2), np.sqrt(3)]) st = {np.dot(x, aa + bb + cc)} for ch in s: if ch == 'a': aa = bb + cc - aa elif ch == 'b': bb = cc + aa - bb elif ch == 'c': cc = aa + bb - cc st.add(np.dot(x, aa + bb + cc)) ans = len(st) print(ans) if __name__ == "__main__": main()