#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
int main()
{
 string s;
 cin>>s;
 int n=s.length();
 vector<int>a(n+1,0);
 for(int i=0;i<n;i++)
 {
     if(s[i]=='<')
       a[i+1]=a[i]+1;
 }
 for(int i=n-1;i>=0;i--)
 {
     if(s[i]=='>')
        a[i]=max(a[i],a[i+1]+1);
 }
  ll ans=0;
  for(int i=0;i<a.size();i++)
    ans+=a[i];
  cout<<ans;
}
