Example

Input

7
>>


Output

7
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define rep(x, s, t) for(int x = s; x <= t; x++)

using namespace std;

int n;
string s;
vector<int> lvec, rvec;

int main(void)
{
	cin >> n;
	cin >> s;
	
	rep(i, 0, n-1){
		if(s[i] == '<') lvec.push_back(i);
		if(s[i] == '>') rvec.push_back(i);
	}
	
	int ans = 0;
	rep(i, 0, n-1)
	{
		int lnum = lower_bound(rvec.begin(), rvec.end(), i) - rvec.begin();
		int rnum =  lvec.end() - lower_bound(lvec.begin(), lvec.end(), i+1);
		//cout << i << ' ' << lnum << ' ' << rnum << endl;
		if(lnum > rnum || lnum == rnum && s[i] == '>'){
			if(s[i] == '<') rnum++;
			ans = max(ans, n-rvec[lnum-rnum]);
		}
		else{
			if(s[i] == '>') lnum++;
			ans = max(ans, lvec[(int)lvec.size()-rnum+lnum-1]+1);
		}
	}
	cout << ans << endl;
}
