s = input()

l = [for i in range(len(s) + 1)]

for x in range(len(s)-1):
    for y in range(len(s)-1-x):
        if '<' == s[y] and l[y] > l[y+1]:
            l[y], l[y+1] = l[y+1], l[y]

        elif '<' == s[y] and l[y] < l[y+1]:
            l[y], l[y+1] = l[y], l[y+1]

        elif '>' == s[y] and l[y] > l[y+1]:
            l[y], l[y+1] = l[y], l[y+1]

        elif '>' == s[y] and l[y] < l[y+1]:
            l[y], l[y+1] = l[y+1], l[y]

print(sum(l))


### FIXED CODE ###

s = input()                                                                                                                                                                                                                                                                                      
buf = 0                                                                                                                                                                                                                                                                                          
str_len = len(s)                                                                                                                                                                                                                                                                                 
total = 0                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                 
while buf < str_len:                                                                                                                                                                                                                                                                             
    l_count = 0                                                                                                                                                                                                                                                                                  
    r_count = 0                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                 
    while buf < str_len and s[buf] == "<":                                                                                                                                                                                                                                                       
        l_count += 1                                                                                                                                                                                                                                                                             
        buf += 1                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                 
    while buf < str_len and s[buf] == ">":                                                                                                                                                                                                                                                       
        r_count += 1                                                                                                                                                                                                                                                                             
        buf += 1                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                 
    n = max(l_count, r_count)                                                                                                                                                                                                                                                                    
    total += n * ( n + 1 ) // 2                                                                                                                                                                                                                                                                  
    m = min(l_count, r_count) - 1                                                                                                                                                                                                                                                                
    total += m * ( m + 1 ) // 2                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                 
print(total)