#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;
    int N = S.size() + 1;
    vector<int> A(N,0);
    for(int i = 0; i < N-1; ++i) {
        if(S[i] == '<') A[i+1] = max(A[i+1], A[i]+1);
    }
    for(int i = N-2; i >= 0; --i) {
        if(S[i] == '>') A[i] = max(A[i], A[i+1]+1);
    }
    long long res = 0LL;
    for(auto &p: A) res += p;
    cout << res << endl;
    return 0;
}