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)       

Measured memory_bytes: 4104