Example

Input

7
>>


Output

7
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int sim(int n, string s, int k) {
  vector<bool> sel(n);
  sel[k] = true;
  int now = k;
  int left = (s[now] == '<' ? true : false);
  int cnt = 1;
  int l = k-1, r = k+1;
  while(1) {
    if(left) {
      now = l;
      l--;
    } else {
      now = r;
      r++;
    }
    if(now == -1 || now == n) break;
    cnt++;
    left = (s[now] == '<' ? true : false);
  }
  // cout << endl;
  return cnt;
}

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);
  int n; cin >> n;
  string s; cin >> s;
  if(n == 1) {
    cout << 1 << endl;
    return 0;
  }

  int l = 0, r = 0;
  for(int i=0;i<n;++i) {
    if(s[i] == '>') break;
    l++;
  }
  for(int i=n-1;i>=0;--i) {
    if(s[i] == '<') break;
    r++;
  }
  cout << max(n - l,n - r) << endl;
}

