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

string s;
long a[500001];
int main() {
  cin >> s;
  const int n = s.size();
  for (int i = 0; i < n; ++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);
  }
  cout << accumulate(a, a + n + 1, 0l) << endl;
}