#include <bits/stdc++.h>
#define ll long long int 
#define MOD 1000000007

using namespace std;


ll modPow(ll x,ll n,ll mod){
	ll r=1;
	x = x%mod;
	while(n){
		if(n&1)r = (r*x)%mod;
		x = (x*x)%mod;
		n = n>>1;
	}
	return r;
}



ll gcd(ll a,ll b,ll &x,ll &y){
	if(a==0){
		x = 0;
		y = 1;
		return b;
	}
	ll x1,y1;
	ll g = gcd(b%a,a,x1,y1);
	x = y1 - (b/a)*x1;
	y = x1;
	return g;
}

vector<ll> sieve(ll n){
	ll i,j;
	ll A[n+1]={0};
	vector<ll> V;
	A[0] = 0;
	A[1] = 1;
	for(i=2;i<n;++i){
		if(A[i]==0)for(j=i;j<n;j+=i)if(A[j]==0)A[j] = i; 
	}
	for(i=0;i<n;++i){
		V.push_back(A[i]);
	}
	return V;
}

template <typename T, typename S> 
ostream& operator<<(ostream& os, const pair<T, S>& v) 
{
    os << "("<< v.first << "," 
           << v.second << ")"; 
      
    return os; 
} 


template <typename T> 
ostream& operator<<(ostream& os, const set<T>& v) 
{ 
    os << "debug : ["; 
    for (auto it : v) { 
        os << it; 
        if (it != *v.rbegin()) 
            os << ", "; 
    } 
    os << "]\n\n"; 
    return os; 
} 

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    os << "debug : ["; 
    for (int i = 0; i < v.size(); ++i) { 
        os << v[i]; 
        if (i != v.size() - 1) 
            os << ", "; 
    } 
    os << "]\n\n"; 
    return os; 
}

template <typename T, typename S> 
ostream& operator<<(ostream& os, const map<T, S>& v) 
{ 
	os << "debug : \n";
    for (auto it : v)  
        os << it.first << " : " 
           << it.second << "\n\n"; 
      
    return os; 
} 

//	 vector<vector<ll> > V(n, vector<ll>(m, 0));
template <class T>
vector <vector<T> > mul(vector <vector<T> > &a, vector <vector<T> > &b,ll mod)
{
    const int n = a.size();     // a rows
    const int m = a[0].size();  // a cols
    const int p = b[0].size();  // b cols

    std::vector <std::vector<T>> c(n, std::vector<T>(p, 0));
    for (auto j = 0; j < p; ++j)
    {
        for (auto k = 0; k < m; ++k)
        {
            for (auto i = 0; i < n; ++i)
            {
                ll temp = (a[i][k] * b[k][j])%mod;
                c[i][j] = (c[i][j]+temp)%mod;
            }
        }
    }
    return c;
}


vector<vector<ll> > modPow(vector<vector<ll> > x,ll n,ll mod){
	vector<vector<ll> > r(x.size(), vector<ll> (x.size(),0));
	ll i,j;
	if(x.size()!=x[0].size()){
		cout<<"error :: \n\n";
	}
	for(i=0;i<x.size();++i)r[i][i]=1;

	while(n){
		if(n&1) r = mul(r,x,mod);
		x = mul(x,x,mod);
		n = n>>1;
	}
	return r;
}

//	Nth fibonacci 
// cin>>t;
// 	while(t--){
// 		cin>>k;
// 		n = 2;m = 2;	
// 		vector<vector<ll> > V(n, vector<ll>(m, 0));
// 		V[0][1] = 1;
// 		V[1][1] = V[1][0] = 1;

// 		vector<vector<ll> > temp = modPow(V,k,MOD);
// 		// for(auto it:temp)cout<<it;
// 		cout<<temp[1][0]<<"\n";
// 	}

bool prime(ll n){
	if(n==1) return false;
	if(n==2) return true;
	if(n%2==0)return false;
	ll r=0,d,i,j,k,l;
	l = n-1;
	while(l%2==0){l=l/2;r++;}
	d = l;
	vector<ll> A = {2,3,5,7,11,13,17,19,23};
	for(auto a:A){
		if(a>n-2) break;
		ll x = modPow(a,d,n);
		if(x==1||x==n-1) continue;
		bool test=false;
		for(i=0;i<r;++i){
			x = (x*x)%n;
			if(x==n-1){
				test=true;
				break;
			}
		}
		if(test)
			continue;
		return false;
	}
	return true;
}

int main(){
	ll t,i,j,k,l,n,m,x,y,a,b,c,r,q;
	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);
	string s;
	cin>>s;
	vector<ll> V;
	vector<char> S;

	for(i=0;i<s.size();++i){
		S.push_back(s[i]);
		l = 1;
		while(i+1<s.size()&&s[i]==s[i+1]){i++;l++;}
		V.push_back(l);
	}
	ll ans=0;
	for(i=0;i<V.size();++i){
		if(S[i]=='<'){
			ans+=(V[i]*(V[i]+1))/2;
		}else{
			ans+=(V[i]*(V[i]+1))/2;
			if(i>0){
				// cout<<V[i-1];
				if(V[i-1]<V[i]){
					ans-=V[i-1];
				}else if(V[i-1]>V[i]){
					ans-=V[i];
				}else{
					ans-=V[i];
				}
			}
		}
	}
	cout<<ans;


	return 0;
}

Measured memory_bytes: 3196