Example

Input

7
>>


Output

7
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define drep(i,x,y) for(int i=x; i>=y; --i)

using namespace std;

deque<int> L, R;
int n, ans;
char s[100100];

int main()
{
	scanf("%d%s",&n,s+1);
	drep(i,n,2) if (s[i] == '<') R.push_front(i);
	rep(i,1,n) {
		int res;
		if (s[i] == '>') {
			if (!R.size()) res = n-i+1;
			else if (L.size() >= R.size()) res = n - L[R.size()-1] + 1;
			else res = R[L.size()];
		} else {
			if (!L.size()) res = i;
			else if (L.size() <= R.size()) res = R[L.size()-1];
			else res = n - L[R.size()] + 1;
		}
		ans = max(ans, res);

		if (s[i] == '>') L.push_front(i);
		if (!R.empty() && R.front() == i+1) R.pop_front();
	}
	printf("%d\n",ans);
}
