S = list(eval(input()))

if S == ['>'] or S == ['<']:

    print((1))

    exit()

m = 0

n = 0

s = 0

l = []

if S[0] == '>':

    l.append(0)

    p = '>'

else:

    p = '<'

c = 1

for i in range(1, len(S)):

    if S[i] == p:

        c += 1

    else:

        l.append(c)

        c = 1

        p = S[i]

if c != 0:

    l.append(c)

if S[-1] == '<':

    l.append(0)

# print(l)

ans = 0



def calc(x):

    if x == 0:

        return 0

    elif x == 1:

        return 1

    else:

        return (1 + x) * x // 2



for i in range(0, len(l), 2):

    # print(l[i], l[i+1])

    ans += calc(l[i]) + calc(l[i + 1]) - min(l[i], l[i + 1])

print(ans)

S = list(eval(input()))

if S == ['>'] or S == ['<']:

    print((1))

    exit()

l = []

if S[0] == '>':

    l.append(0)

    p = '>'

else:

    p = '<'

c = 1

for i in range(1, len(S)):

    if S[i] == p:

        c += 1

    else:

        l.append(c)

        c = 1

        p = S[i]

if c != 0:

    l.append(c)

if S[-1] == '<':

    l.append(0)

ans = 0





def calc(x):

    return (1 + x) * x // 2





for i in range(0, len(l), 2):

    ans += calc(l[i]) + calc(l[i + 1]) - min(l[i], l[i + 1])

print(ans)

S = list(eval(input()))
if S == [">"] or S == ["<"]:
    print((1))
    exit()
m = 0
n = 0
s = 0
l = []
if S[0] == ">":
    l.append(0)
    p = ">"
else:
    p = "<"
c = 1
for i in range(1, len(S)):
    if S[i] == p:
        c += 1
    else:
        l.append(c)
        c = 1
        p = S[i]
if c != 0:
    l.append(c)
if S[-1] == "<":
    l.append(0)
# print(l)
ans = 0


def calc(x):
    if x == 0:
        return 0
    elif x == 1:
        return 1
    else:
        return (1 + x) * x // 2


for i in range(0, len(l), 2):
    # print(l[i], l[i+1])
    ans += calc(l[i]) + calc(l[i + 1]) - min(l[i], l[i + 1])
print(ans)

S = list(eval(input()))
if S == [">"] or S == ["<"]:
    print((1))
    exit()
l = []
if S[0] == ">":
    l.append(0)
    p = ">"
else:
    p = "<"
c = 1
for i in range(1, len(S)):
    if S[i] == p:
        c += 1
    else:
        l.append(c)
        c = 1
        p = S[i]
if c != 0:
    l.append(c)
if S[-1] == "<":
    l.append(0)
ans = 0


def calc(x):
    return (1 + x) * x // 2


for i in range(0, len(l), 2):
    ans += calc(l[i]) + calc(l[i + 1]) - min(l[i], l[i + 1])
print(ans)

-m = 0 -n = 0 -s = 0 -# print(l) -    if x == 0: -        return 0 -    elif x == 1: -        return 1 -    else: -        return (1 + x) * x // 2 +    return (1 + x) * x // 2 -    # print(l[i], l[i+1])