#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    string s;
    ll ans = 0;
    cin >> s;
    for(int i = 0; i < (int)s.size(); ++i){
        int r = i, a = 0, b = 0;
        while(r < (int)s.size() && s[r] == '<')
            r++, a++;
        while(r < (int)s.size() && s[r] == '>')
            r++, b++;
        ans += 1LL * a * (a + 1) / 2 + 1LL * b * (b + 1) / 2 - min(a, b);
        i = r - 1;
    }
    cout << ans;
    return 0;
}
