Example

Input

7
>>


Output

7
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    int firstRight = n, lastLeft = -1;
    for (int i = 0; i < n; i++) {
        if (s[i] == '>') firstRight = min(firstRight, i);
        else lastLeft = max(lastLeft, i);
    }
    int ans = 0;
    if (firstRight != n) ans = max(ans, n - firstRight);
    if (lastLeft != -1) ans = max(ans, lastLeft + 1);
    cout << ans << endl;
    return 0;
}

