#include<iostream>
#include<vector>
#include<numeric>
using namespace std;

int main(){
    string s; cin>>s;
    vector<int> a(s.length()+1,0);

    for(int i=0;i<s.length();i++){
        if(s[i]=='<'){
            a[i+1]=max(a[i+1],a[i]+1);
        }
    }

    for(int i=s.length()-1;i>=0;i--){
        if(s[i]=='>'){
            a[i]=max(a[i],a[i+1]+1);
        }
    }

    cout<<accumulate(a.begin(),a.end(),0LL)<<endl;
}