#include <bits/stdc++.h>
using namespace std;
int d[300000], n, sm = 0, vis[300000];
string a;
int dfs(int x) {
  if (x < 0 || x >= n) {
    return 1;
  }
  if (d[x] != -1) return d[x];
  d[x] = 0;
  if (a[x] == '>')
    d[x] += dfs(x + 1);
  else
    d[x] += dfs(x - 1);
  return d[x];
}
int main() {
  memset(d, -1, sizeof(d));
  cin >> n;
  cin >> a;
  int m = 0;
  for (int i = 0; i < n; i++) m += dfs(i);
  cout << m;
  return 0;
}
