from collections import defaultdict, deque, Counter
# from functools import cache
# import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
# from more_itertools import distinct_permutations
from heapq import heapify, heappop, heappush
import math
import bisect
# from pprint import pprint
from random import randint, shuffle, randrange
# from sortedcontainers import SortedSet, SortedList, SortedDict
import sys
# sys.setrecursionlimit(2000000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)

#################################################   

S = input()

stack = []
ans = 0

q = 0
for s in S:
    stack.append(s)
    if q == 0:
        if s == "<":
            q = 1
        else:
            ans += len(stack)
            stack.clear()
            q = 0
    elif q == 1:
        if s == "=":
            q = 2
        elif s == "<":
            q = 1
        else:
            ans += len(stack)
            stack.clear()
            q = 0
    else:
        if s == "=":
            q = 2
        elif s == ">":
            stack.pop()
            while stack[-1] == "=":
                stack.pop()
            stack.pop()
            if stack:
                if stack[-1] == "=":
                    q = 2
                elif stack[-1] == "<":
                    q = 1
            else:
                q = 0
        elif s == "<":
            q = 1

ans += len(stack)
print(ans)