import math

import bisect

import collections

import itertools

import heapq

import string

import sys

sys.setrecursionlimit(10**9)

def gcd(a,b):return math.gcd #最大公約数

def lcm(a,b):return (a*b) // math.gcd(a,b) #最小公倍数

def iin(): return int(eval(input())) #整数読み込み

def isn(): return input().split() #文字列読み込み

def imn(): return list(map(int, input().split())) #整数map取得

def iln(): return list(map(int, input().split())) #整数リスト取得

def iln_s(): return sorted(iln()) # 昇順の整数リスト取得

def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得

def join(l, s=''): return s.join(l) #リストを文字列に変換

def perm(l, n): return itertools.permutations(l, n) # 順列取得

def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数

def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得

def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数

def divisors(n):

    divisors = []

    for i in range(1, int(n**0.5)+1):

        if n % i == 0:

            divisors.append(i)

            if i != n // i: divisors.append(n//i)

    return divisors

def is_prime(n):

    if n == 1: return False

    for i in range(2, int(n**0.5) + 1):

        if n % i == 0: return False 

    return True

def primes(n):

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

    for i in range(2, int(n**0.5)+1):

        if not is_prime[i]: continue

        for j in range(i * 2, n + 1, i): is_prime[j] = False

    return [i for i in range(n+1) if is_prime[i]]

def sieve_of_e(n):

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

    for i in range(2, int(n**0.5)+1):

        if not is_prime[i]: continue

        for j in range(i * 2, n+1, i): is_prime[j] = False

    return is_prime



S=eval(input())



l = len(S)

l_cnt = [0] * (l+1)

r_cnt = [0] * (l+1)

cnt = [0] * (l+1)

for i in range(l):

    if S[i] == '<':

        l_cnt[i+1] = l_cnt[i]+1

for i in range(l-1, -1, -1):

    if S[i] == '>':

        r_cnt[i] = r_cnt[i+1]+1

for i in range(l+1):

    cnt[i] = max(l_cnt[i], r_cnt[i])

print((sum(cnt)))



import math

import fractions

import bisect

import collections

import itertools

import heapq

import string

import sys

sys.setrecursionlimit(10**9)

def gcd(a,b):return fractions.gcd(a,b) #最大公約数

def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数

def iin(): return int(eval(input())) #整数読み込み

def isn(): return input().split() #文字列読み込み

def imn(): return list(map(int, input().split())) #整数map取得

def iln(): return list(map(int, input().split())) #整数リスト取得

def iln_s(): return sorted(iln()) # 昇順の整数リスト取得

def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得

def join(l, s=''): return s.join(l) #リストを文字列に変換

def perm(l, n): return itertools.permutations(l, n) # 順列取得

def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数

def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得

def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数

def divisors(n):

    divisors = []

    for i in range(1, int(n**0.5)+1):

        if n % i == 0:

            divisors.append(i)

            if i != n // i: divisors.append(n//i)

    return divisors

def is_prime(n):

    if n == 1: return False

    for i in range(2, int(n**0.5) + 1):

        if n % i == 0: return False 

    return True

def primes(n):

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

    for i in range(2, int(n**0.5)+1):

        if not is_prime[i]: continue

        for j in range(i * 2, n + 1, i): is_prime[j] = False

    return [i for i in range(n+1) if is_prime[i]]

def sieve_of_e(n):

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

    for i in range(2, int(n**0.5)+1):

        if not is_prime[i]: continue

        for j in range(i * 2, n+1, i): is_prime[j] = False

    return is_prime



S=eval(input())

 

l = len(S)

cnt = [0] * (l+1)

for i in range(l):

    if S[i] == '<':

        cnt[i+1] = cnt[i]+1

for i in range(l-1, -1, -1):

    if S[i] == '>':

        cnt[i] = max(cnt[i], cnt[i+1]+1)

print((sum(cnt)))
import math
import bisect
import collections
import itertools
import heapq
import string
import sys

sys.setrecursionlimit(10**9)


def gcd(a, b):
    return math.gcd  # 最大公約数


def lcm(a, b):
    return (a * b) // math.gcd(a, b)  # 最小公倍数


def iin():
    return int(eval(input()))  # 整数読み込み


def isn():
    return input().split()  # 文字列読み込み


def imn():
    return list(map(int, input().split()))  # 整数map取得


def iln():
    return list(map(int, input().split()))  # 整数リスト取得


def iln_s():
    return sorted(iln())  # 昇順の整数リスト取得


def iln_r():
    return sorted(iln(), reverse=True)  # 降順の整数リスト取得


def join(l, s=""):
    return s.join(l)  # リストを文字列に変換


def perm(l, n):
    return itertools.permutations(l, n)  # 順列取得


def perm_count(n, r):
    return math.factorial(n) // math.factorial(n - r)  # 順列の総数


def comb(l, n):
    return itertools.combinations(l, n)  # 組み合わせ取得


def comb_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))  # 組み合わせの総数


def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return divisors


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def sieve_of_e(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return is_prime


S = eval(input())
l = len(S)
l_cnt = [0] * (l + 1)
r_cnt = [0] * (l + 1)
cnt = [0] * (l + 1)
for i in range(l):
    if S[i] == "<":
        l_cnt[i + 1] = l_cnt[i] + 1
for i in range(l - 1, -1, -1):
    if S[i] == ">":
        r_cnt[i] = r_cnt[i + 1] + 1
for i in range(l + 1):
    cnt[i] = max(l_cnt[i], r_cnt[i])
print((sum(cnt)))

import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys

sys.setrecursionlimit(10**9)


def gcd(a, b):
    return fractions.gcd(a, b)  # 最大公約数


def lcm(a, b):
    return (a * b) // fractions.gcd(a, b)  # 最小公倍数


def iin():
    return int(eval(input()))  # 整数読み込み


def isn():
    return input().split()  # 文字列読み込み


def imn():
    return list(map(int, input().split()))  # 整数map取得


def iln():
    return list(map(int, input().split()))  # 整数リスト取得


def iln_s():
    return sorted(iln())  # 昇順の整数リスト取得


def iln_r():
    return sorted(iln(), reverse=True)  # 降順の整数リスト取得


def join(l, s=""):
    return s.join(l)  # リストを文字列に変換


def perm(l, n):
    return itertools.permutations(l, n)  # 順列取得


def perm_count(n, r):
    return math.factorial(n) // math.factorial(n - r)  # 順列の総数


def comb(l, n):
    return itertools.combinations(l, n)  # 組み合わせ取得


def comb_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))  # 組み合わせの総数


def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return divisors


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def sieve_of_e(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return is_prime


S = eval(input())
l = len(S)
cnt = [0] * (l + 1)
for i in range(l):
    if S[i] == "<":
        cnt[i + 1] = cnt[i] + 1
for i in range(l - 1, -1, -1):
    if S[i] == ">":
        cnt[i] = max(cnt[i], cnt[i + 1] + 1)
print((sum(cnt)))

+import fractions -    return math.gcd  # 最大公約数 +    return fractions.gcd(a, b)  # 最大公約数 -    return (a * b) // math.gcd(a, b)  # 最小公倍数 +    return (a * b) // fractions.gcd(a, b)  # 最小公倍数 -l_cnt = [0] * (l + 1) -r_cnt = [0] * (l + 1) -        l_cnt[i + 1] = l_cnt[i] + 1 +        cnt[i + 1] = cnt[i] + 1 -        r_cnt[i] = r_cnt[i + 1] + 1 -for i in range(l + 1): -    cnt[i] = max(l_cnt[i], r_cnt[i]) +        cnt[i] = max(cnt[i], cnt[i + 1] + 1)