#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll inf = 3e18;
const char sp = ' ';

int N, A[500000];
ll res;
string S;

int main() {
	cin >> S;
	N = S.size() + 1;
	for (int i = 0; i < N - 1; i++) {
		if (S[i] == '<') {
			A[i + 1] = A[i] + 1;
		}
	}
	for (int i = N - 1; i >= 0; i--) {
		if (S[i] == '>') {
			A[i] = max(A[i], A[i + 1] + 1);
		}
	}
	for (int i = 0; i < N; i++) {
		res += A[i];
	}
	cout << res << endl;
}