Example

Input

7
>>


Output

7
#include"bits/stdc++.h"

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7



int main()
{
	int n;
	string s;
	cin >> n >> s;

	vector<int> imosL(n), imosR(n), posL, posR;
	REP(i, n) {
		if (s[i] == '>') {
			imosR[i]++;
			posR.push_back(i);
		}
		else {
			imosL[i]++;
			posL.push_back(i);
		}
	}
	REP(i, n - 1) {
		imosL[i + 1] += imosL[i];
		imosR[i + 1] += imosR[i];
	}

	int res = 0;
	REP(i, n) {
		int leftR = i == 0 ? 0 : imosR[i - 1];
		int rightL = imosL.back() - imosL[i];
		if (s[i] == '>') {
			if (leftR < rightL) {
				res = max(res, posL[i] + 1);
			}
			else {
				int cnt = n - 1 - i;
				res = max(res, n - posR[posR.size() - 1 - cnt] );
			}
		}
		else {
			if (leftR > rightL) {
				int cnt = n - 1 - i;
				res = max(res, n - posR[posR.size() - 1 - cnt] );
			}
			else {
				res = max(res, posL[i] + 1);
			}
		}
	}
	cout << res << endl;
	return 0;
}

