#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)

int const N = 500000;
char s[N];
int x[N];

int main(){
	scanf("%s", s);
	int n = strlen(s) + 1;
	f(i, 1, n)x[i] = s[i - 1] == '<' ? x[i - 1] + 1: 0;
	for (int i = n - 2; i >= 0; --i)if (s[i] == '>')x[i] = max(x[i], x[i + 1] + 1);
	ll an = 0;
	f(i, 0, n)an += x[i];
	printf("%lld\n", an);
}