Example

Input

7
>>


Output

7
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2730
#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

#define MAX

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int n;
	string s;
	vector<pair<int,int>> line;
	int a1, b1, a2, b2, ans = 0;
	cin>>n>>s;
	
	a1 = n, b1 = n, a2 = -1, b2 = -1;
	
	line.push_back(make_pair(0,0));
	
	for(int i = 0, a = 0, b = 0, c = 0; i < n; i++){
		if(s[i] == '>' && a1 == n) a1 = i;
		if(s[i] == '<' && b1 == n) b1 = i;
		if(s[i] == '>') a2 = i;
		if(s[i] == '<') b2 = i;
	}
	
	ans = max(max(a2 - a1 + 1, b2 - b1 + 1), max(1ll, b2 - a1 + 1));
	
	cout<<ans<<endl;
	
	return 0;
}
