#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char A[200023];
  cin >> A;
  int l = 0;
  int f = 0;
  bool first = 0;
  for (int i = 0; i < n; i++) {
    if (A[i] == '>' && A[i + 1] == '<' && i < n) {
      l = i + 1;
      if (first == 0) {
        first = 1;
        f = i;
      }
    }
  }
  if (f != 0 || l != 0) {
    for (int j = f; j >= 0; j--) {
      if (A[j] == '>')
        f = j;
      else
        break;
    }
    for (int j = l; j < n; j++) {
      if (A[j] == '<')
        l = j;
      else
        break;
    }
  }
  int ans = f + n - 1 - l;
  if (f == 0 && l == 0) {
    ans = n;
  }
  cout << ans << endl;
  return 0;
}
