S = input() cur = [] for c in S: if c == '=': if len(cur) and cur[-1][0]=='=': cur[-1][1]+=1 else: cur.append([c, 1]) else: cur.append([c, 1]) if len(cur)>=3 and cur[-3][0] == '<' and cur[-2][0] == '=' and cur[-1][0] == '>': cur.pop() cur.pop() cur.pop() ans = 0 for (c, l) in cur: ans += l print(ans)