Example

Input

7
>>


Output

7
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	string in;
	cin>>n>>in;
//	in="<"+in+">";
//	n+=2;
	vp dp(n);
	vi ri,le;
	int co=0;
	rep(i,n){
		if(in[i]=='>'){
			co++;
			ri.pb(i);
		}
		dp[i].first=co;
	}
	co=0;
	rep(i,n){
		if(in[n-1-i]=='<'){
			co++;
			le.pb(n-1-i);
		}
		dp[n-1-i].second=co;
	}
//	rep(i,ri.size())cout<<ri[i]<<endl;
//	rep(i,le.size())cout<<le[i]<<endl;
//	rep(i,n)cout<<dp[i].first<<" "<<dp[i].second<<endl;
	int out=max(dp[0].second,dp[n-1].first);
	rep(i,n-1){
		int a=dp[i].first,b=dp[i+1].second;
		if(a<=b){
			int t=le[b-min(a+1,b)];
			out=max(out,t+1);
		}
		if(a>=b){
			int t=ri[a-min(a,b+1)];
			out=max(out,n-t);
		}
	}
	cout<<out<<endl;
}
//  < < < > < < > > >
//  0 0 0 1 1 1 2 3 4
//  5 4 3 2 2 1 0 0 0