Example

Input

7
>>


Output

7
#include<iostream>
#include<cstdio>
#include<cstring>

const int N = 100100;

using namespace std;
int i,j,s1,s2,n,m,ans, sum, c1, c2;
bool a[N];
int p1[N], p2[N], l[N], r[N];
char ch;
inline int Abs(int x){
	return x<0?-x:x;
}
int main()
{
	scanf("%d\n",&n);
	for (int i = 1; i <= n; i++) {
		ch = getchar();
		if (ch == '>') {
			a[i] = 1; l[i]++; p1[++c1] = i;
		}
	}
	for (int i = n; i; i--) {
		r[i] = r[i - 1];
		if (!a[i]) {
			r[i]++; p2[++c2] = i;
		}
	}
	for (int i = 1; i <= n; i++) {
		if (a[i]) {
			if (l[i] >= r[i]) {
				sum = n - p1[l[i] - r[i]] + 1;
			} else {
				sum = p2[r[i] - l[i] + 1];
			}
		} else {
			if (l[i] <= r[i]) {
				sum = p2[r[i] - l[i]];
			} else {
				sum = n - p1[l[i] - r[i] + 1] + 1;
			}
		}
		ans = max(ans, sum);
	}
	printf("%d\n",ans); 
	return 0;
}