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

using ll=long long;
const ll MOD=1000000007;

int main() {
  string s;
  cin >> s;
  ll N=s.size(),sum=0;
  vector<int> a(N+1,0);
  for(int i=0;i<N;i++){
    if(s[i]=='<'){
      a[i+1]=a[i]+1;
    }
    //cout << a[i] << endl;
  }
  for(int i=N-1;i>=0;i--){
    if(s[i]=='>'){
      a[i]=max(a[i+1]+1,a[i]);
    }
  }
  for(int i=0;i<N+1;i++){
    sum +=a[i];
    //cout << a[i] << endl;
  }
  cout << sum << endl;
}
