Example

Input

7
>>


Output

7
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;


inline int read(char *s){
  char c=getchar(); int len=0;
  for (;!(c=='<' || c=='>');c=getchar());
  for (;c=='<' || c=='>';s[++len]=c,c=getchar()); return len;
}

int n;

char S[100005];
int a[100005];
int pnt;
char s[100005];

int main(){
  scanf("%d",&n);
  read(S);
  for (int i=1;i<=n;i++)
    if (S[i]!=S[i-1])
      s[++pnt]=S[i],a[pnt]=1;
    else
      a[pnt]++;
  int ans=n;
  int maxv=0;
  if (s[1]=='<')
    maxv=max(maxv,a[1]),ans-=a[1];
  if (s[pnt]=='>')
    maxv=max(maxv,a[pnt]),ans-=a[pnt];
  ans+=maxv;
  printf("%d\n",ans);
}