S = input() st = [] for c in S: match c: case '<': st.append((c, 1)) case '=': if st and st[-1][0] == '=': _, cnt = st.pop() st.append((c, cnt+1)) else: st.append((c, 1)) case '>': if len(st) >= 2 and st[-2][0] == '<' and st[-1][0] == '=': st.pop() st.pop() else: st.append((c, 1)) print(sum(cnt for _, cnt in st))