Buggy python submission (verdict: Time Limit Exceeded):
def count_seq_l(s):
    tmp_cnt = 0
    for s_tmp in s[::-1]:
        if s_tmp == '<':
            tmp_cnt += 1
        else:
            break

    return tmp_cnt
def count_seq_r(s):
    tmp_cnt = 0
    for s_tmp in s:
        if s_tmp == '>':
            tmp_cnt += 1
        else:
            break
    return tmp_cnt

if __name__ == '__main__':
    S = input()
    res = 0
    for i in range(len(S) + 1):
        l_s = S[:i]
        r_s = S[i:]
        l_cnt = len(l_s.split('>')[-1])
        r_cnt = len(r_s.split('<')[0])
        tmp = max(l_cnt, r_cnt)
        res += tmp
    print(res)
    

Fixed submission:
if __name__ == '__main__':
    S = input()
    n = len(S)
    l_res = [0]
    r_res = [0]
    for i in range(n):
        if S[i] == '<':
            l_res.append(l_res[i] + 1)
        else:
            l_res.append(0)
    inv_S = S[::-1]

    for i in range(n):
        if inv_S[i] == '>':
            r_res.append(r_res[i] + 1)
        else:
            r_res.append(0)
    res = 0
    for l_cnt, r_cnt in zip(l_res, r_res[::-1]):
        res += max(l_cnt, r_cnt)
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
def count_seq_l(s):
    tmp_cnt = 0
    for s_tmp in s[::-1]:
        if s_tmp == '<':
            tmp_cnt += 1
        else:
            break

    return tmp_cnt
def count_seq_r(s):
    tmp_cnt = 0
    for s_tmp in s:
        if s_tmp == '>':
            tmp_cnt += 1
        else:
            break
    return tmp_cnt

if __name__ == '__main__':
    S = input()
    res = 0
    for i in range(len(S) + 1):
        l_s = S[:i]
        r_s = S[i:]
        l_cnt = len(l_s.split('>')[-1])
        r_cnt = len(r_s.split('<')[0])
        tmp = max(l_cnt, r_cnt)
        res += tmp
    print(res)
    

Fixed submission:
if __name__ == '__main__':
    S = input()
    n = len(S)
    l_res = [0]
    r_res = [0]
    for i in range(n):
        if S[i] == '<':
            l_res.append(l_res[i] + 1)
        else:
            l_res.append(0)
    inv_S = S[::-1]

    for i in range(n):
        if inv_S[i] == '>':
            r_res.append(r_res[i] + 1)
        else:
            r_res.append(0)
    res = 0
    for l_cnt, r_cnt in zip(l_res, r_res[::-1]):
        res += max(l_cnt, r_cnt)
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
def count_seq_l(s):
    tmp_cnt = 0
    for s_tmp in s[::-1]:
        if s_tmp == '<':
            tmp_cnt += 1
        else:
            break

    return tmp_cnt
def count_seq_r(s):
    tmp_cnt = 0
    for s_tmp in s:
        if s_tmp == '>':
            tmp_cnt += 1
        else:
            break
    return tmp_cnt

if __name__ == '__main__':
    S = input()
    res = 0
    for i in range(len(S) + 1):
        l_s = S[:i]
        r_s = S[i:]
        l_cnt = count_seq_l(l_s)
        r_cnt = count_seq_r(r_s)
        tmp = max(l_cnt, r_cnt)
        res += tmp
    print(res)
    

Fixed submission:
if __name__ == '__main__':
    S = input()
    n = len(S)
    l_res = [0]
    r_res = [0]
    for i in range(n):
        if S[i] == '<':
            l_res.append(l_res[i] + 1)
        else:
            l_res.append(0)
    inv_S = S[::-1]

    for i in range(n):
        if inv_S[i] == '>':
            r_res.append(r_res[i] + 1)
        else:
            r_res.append(0)
    res = 0
    for l_cnt, r_cnt in zip(l_res, r_res[::-1]):
        res += max(l_cnt, r_cnt)
    print(res)