#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=500050;
char s[N];
int l[N],r[N];
int main()
{
	scanf("%s",s+1);
	int n=strlen(s+1);
	for(int i=1;i<=n;i++)
	{
		if(s[i]=='<') l[i]=l[i-1]+1;
		else l[i]=0;
	}
	for(int i=n;i>=1;i--)
	{
		if(s[i]=='>') r[i]=r[i+1]+1;
		else r[i]=0;
	}
	ll ans=0;
	for(int i=0;i<=n;i++) ans+=max(l[i],r[i+1]);
	printf("%lld\n",ans);
	return 0;
}