#include <bits/stdc++.h>
using namespace std;
int l[500001],r[500001];
int main (){
  string s;
  cin>>s;
  int i;
  long long int sum=0;
  for(i=0;i<s.length();i++){
    if(s[i]=='<')l[i+1]=l[i]+1;
  }
  for(i=s.length()-1;i>=0;i--){
    if(s[i]=='>')r[i]=r[i+1]+1;
  }
  for(i=0;i<=s.length();i++){
    sum+=max(r[i],l[i]);
  }
  cout<<sum<<endl;
  return 0;
}
  
