#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int lf = -1, rg = n;
  for (int i = 0; i < n; i++) {
    if (s[i] == '>') {
      break;
    }
    lf = i;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '<') {
      break;
    }
    rg = i;
  }
  if (lf > rg)
    cout << 0;
  else
    cout << n - (rg - lf - 1);
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
