Example

Input

7
>>


Output

7
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
const int MOD = 1e9 + 7;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
using namespace std;
typedef long long ll;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    char ch[n + 1];
    for(int i = 0; i < n; i++)
    {
        cin >> ch[i];
    }
    int left_cnt = 0;
    int right_cnt = 0;
    if(ch[0] == '>' && ch[n -1] == '<')
    {
        cout << n << endl;
        return 0;
    }
    for(int i = 0; i < n; i++)
    {
        if(ch[i] == '<')
            left_cnt++;
        else
            break;
    }
    for(int i = n - 1; i >= 0; i--)
    {
        if(ch[i] == '>')
            right_cnt++;
        else
            break;
    }
    cout << n - min(left_cnt, right_cnt) << endl;
    return 0;
}
