Example

Input

7
>>


Output

7
#include<bits/stdc++.h>
using namespace std;
#define MAX 100050
string s;
int n,ans,memo[MAX];
int calc(int x){
  if(~memo[x]) return memo[x];
  int res=0;
  int l=x,r=x;
  while(1){
    if(s[x]=='>') x=++r;
    else x=--l;
    res++;
    if(l<0||n<=r) break;
  }
  ans=max(ans,res);
  return memo[x]=res;
}
int main(){
  cin>>n>>s;
  memset(memo,-1,sizeof(memo));
  int l=0,r=s.size()-1,m1,m2;
  while(l+1<r){
    m1=l+(r-l)/3;
    m2=l+(r-l)*2/3;
    calc(l);calc(r);
    if(calc(m1)<calc(m2)) l=m1+1;
    else r=m2-1;
  }
  calc(l);calc(r);
  cout << ans << endl;
  return 0;
}