Example

Input

7
>>


Output

7
#include <iostream>
using namespace std;

int main(){
    int N;
    string S;
    cin >> N >> S;
    int l = N-1,r = 0;
    for(int i=0;i<N;i++){
        if(S[i]=='>') l = min(l,i);
        else r = max(r,i);
    }
    cout << r-l+1 + max(l,N-1-r) << endl;
}
