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

int a[500005];

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