

def modelAnswer(S:list) -> int:

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

   for n,s in enumerate(S):

      if(s == "<"):

         l[n+1] = l[n] + 1

   for n,s in enumerate(S[::-1]):

      if(s == ">"):

         tmp = l[len(S) - n] + 1

         if (tmp > l[len(S) - n - 1]):

            l[len(S) -n - 1] = tmp

   return sum(l)

def main():

   S = list(eval(input()))

   print((modelAnswer(S[:])))

if __name__ == '__main__':

   main()
def myAnswer(S:list) -> int:

   N = len(S)+1

   ans = [0]*N

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

      if(S[i] == ">"):

         ans[i] = ans[i+1]+1

   # print(ans)

   for i in range(len(S)):

      if(S[i]== "<"):

         if(ans[i] >= ans[i + 1]):

            ans[i + 1] = ans[i]+1

   # print(ans)

   return sum(ans)

def modelAnswer(S:list) -> int:

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

   for n,s in enumerate(S):

      if(s == "<"):

         l[n+1] = l[n] + 1

   for n,s in enumerate(S[::-1]):

      if(s == ">"):

         tmp = l[len(S) - n] + 1

         if (tmp > l[len(S) - n - 1]):

            l[len(S) -n - 1] = tmp

   return sum(l)

def main():

   S = list(eval(input()))

   print((myAnswer(S[:])))

if __name__ == '__main__':

   main()
def modelAnswer(S: list) -> int:
    l = [0 for i in range(len(S) + 1)]
    for n, s in enumerate(S):
        if s == "<":
            l[n + 1] = l[n] + 1
    for n, s in enumerate(S[::-1]):
        if s == ">":
            tmp = l[len(S) - n] + 1
            if tmp > l[len(S) - n - 1]:
                l[len(S) - n - 1] = tmp
    return sum(l)


def main():
    S = list(eval(input()))
    print((modelAnswer(S[:])))


if __name__ == "__main__":
    main()

def myAnswer(S: list) -> int:
    N = len(S) + 1
    ans = [0] * N
    for i in range(len(S) - 1, -1, -1):
        if S[i] == ">":
            ans[i] = ans[i + 1] + 1
    # print(ans)
    for i in range(len(S)):
        if S[i] == "<":
            if ans[i] >= ans[i + 1]:
                ans[i + 1] = ans[i] + 1
    # print(ans)
    return sum(ans)


def modelAnswer(S: list) -> int:
    l = [0 for i in range(len(S) + 1)]
    for n, s in enumerate(S):
        if s == "<":
            l[n + 1] = l[n] + 1
    for n, s in enumerate(S[::-1]):
        if s == ">":
            tmp = l[len(S) - n] + 1
            if tmp > l[len(S) - n - 1]:
                l[len(S) - n - 1] = tmp
    return sum(l)


def main():
    S = list(eval(input()))
    print((myAnswer(S[:])))


if __name__ == "__main__":
    main()

+def myAnswer(S: list) -> int: +    N = len(S) + 1 +    ans = [0] * N +    for i in range(len(S) - 1, -1, -1): +        if S[i] == ">": +            ans[i] = ans[i + 1] + 1 +    # print(ans) +    for i in range(len(S)): +        if S[i] == "<": +            if ans[i] >= ans[i + 1]: +                ans[i + 1] = ans[i] + 1 +    # print(ans) +    return sum(ans) + + -    print((modelAnswer(S[:]))) +    print((myAnswer(S[:])))