#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define SP << " " <<





int main(void){
	
    string S;
    cin >> S;

    ll N = S.size();
    ll ans = 0;
    ll cp = 0;
    ll cn = 0;

    rep(i,N){
        if(S[i] == '<'){
            cp++;
        }else{
            cn++;
        }

        if(i<N-1){
            if(S[i] == S[i+1]){

            }else{
                if(S[i] == '<'){
                    ans += cp*(cp+1)/2;
                    
                }else{
                    ans += cn*(cn+1)/2;
                    ans -= min(cp,cn);
                    cp = 0;
                    cn = 0;
                }
            }
        }

    }

    if(cn == 0){
        ans += cp*(cp+1)/2;
    }else{
        ans += cn*(cn+1)/2;
        ans -= min(cp,cn);
        cp = 0;
        cn = 0;
    }



   /*  if(S[0] == '<'){
        ll a = 1;
        reps(i,N-1){
            if(S[i-1] == '<'){
                if(S[i] == '<'){
                    cnt++;
                    cout << cnt << " ";
                    a = cnt;
                }else{
                    ans += cnt*(cnt+1)/2;
                    cnt = 1;
                }

            }else{  //S[i-1] == '>'
                if(S[i] == '>'){
                    cnt++;
                    //cout << cnt << " ";
                }else{
                    ans += cnt*(cnt+1)/2;
                    ans -= min(a,cnt);
                    cnt = 1;
                    a = 1;
                }
            }

        }
        if(S[N-1] == '>'){
            ans += cnt*(cnt+1)/2;
            ans -= min(a,cnt);
        }else{
            ans += cnt*(cnt+1)/2;
        }
    }else{
        ll a = 0;
        reps(i,N-1){
            if(S[i-1] == '<'){
                if(S[i] == '<'){
                    cnt++;
                    //cout << cnt << " ";
                    a = cnt;
                }else{
                    ans += cnt*(cnt+1)/2;
                    cnt = 1;
                }

            }else{  //S[i-1] == '>'
                if(S[i] == '>'){
                    cnt++;
                    //cout << cnt << " ";
                }else{
                    ans += cnt*(cnt+1)/2;
                    ans -= min(a,cnt);
                    cnt = 1;
                    a = 1;
                }
            }

        }
        if(S[N-1] == '>'){
            ans += cnt*(cnt+1)/2;
            ans -= min(a,cnt);
        }else{
            ans += cnt*(cnt+1)/2;
        }
    } */

    
    

    cout << ans << endl;    

    return 0;
}


Measured memory_bytes: 900