input()
cur = 0
res = 0
for a in map(int, input().split()):
    cur += a % 2
    a //= 2
    if a < cur:
        cur -= a
        res += a
    else:
        res += cur
        cur = (a - cur) * 2
        res += cur // 3
        cur %= 3
print(res)


import math
import bisect
import heapq

from collections import defaultdict

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, x, y = egcd(b % a, a)
        return (g, y - (b // a) * x, x)

def mulinv(b, n):
    g, x, _ = egcd(b, n)
    if g == 1:
        return x % n

primes = []

def isprime(n):
    for d in range(2, int(math.sqrt(n))+1):
        if n%d==0:
            return False
    return True

def argsort(ls):
    return sorted(range(len(ls)), key=ls.__getitem__)

def f(p=0):
    if p==1:
        return map(int, input().split())
    elif p==2:
        return list(map(int, input().split()))
    else:
        return int(input())

n = f()
cl = f(2)

count = 0
pos = 0
c = cl[0]//3
cl[0]-=c*3
count+=c
sm = cl[0]

for i in range(1, n):
    c = cl[i] // 3
    count += c
    cl[i]-=c*3
    a = sm
    b = cl[i]//2
    t = min(a, b)
    sm+=cl[i]
    count+=t
    sm-=t*3
    cl[i]-=t*2

print(count)


import math
import bisect
import heapq

from collections import defaultdict

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, x, y = egcd(b % a, a)
        return (g, y - (b // a) * x, x)

def mulinv(b, n):
    g, x, _ = egcd(b, n)
    if g == 1:
        return x % n

primes = []

def isprime(n):
    for d in range(2, int(math.sqrt(n))+1):
        if n%d==0:
            return False
    return True

def argsort(ls):
    return sorted(range(len(ls)), key=ls.__getitem__)

def f(p=0):
    if p==1:
        return map(int, input().split())
    elif p==2:
        return list(map(int, input().split()))
    else:
        return int(input())

n = f()
cl = f(2)

count = 0
sm = 0

for i in range(n):
    a = sm
    b = cl[i]//2
    t = min(a, b)
    count+=t
    sm += cl[i]
    cl[i]-=t*2
    sm-=t*3
    c = cl[i] // 3
    sm-=c*3
    count+=c

print(count)


n=int(input())
a=[int(i) for i in input().split()]
count=0
pairs=0
for i in range(len(a)-1,-1,-1):
    pairs+=a[i]//2
    if(a[i]%2==1):
        count+=1
        pairs-=1
count=(pairs*2)//3
print(3)


n=int(input())
a=[int(i) for i in input().split()]
count=0
pairs=0
for i in range(len(a)-1,-1,-1):
    pairs+=a[i]//2
    if(a[i]%2==1 and pairs>0):
        count+=1
        pairs-=1
count+=(pairs*2)//3
print(count)


n=int(input())
a=[int(i) for i in input().split()]
count=0
pairs=0
for i in range(len(a)-1,-1,-1):
    pairs+=a[i]//2
    if(a[i]%2==1):
        count+=1
        pairs-=1
count=(pairs*2)//3
print(count)


n=int(input())
a=[int(i) for i in input().split()]
count=0
pairs=0
for i in range(len(a)-1,-1,-1):
    pairs+=a[i]//2
    if(a[i]%2==1):
        count+=1
        pairs-=1
count+=(pairs*2)//3
print(count)


n = int(input())
a = list(map(int, input().split()))
c = 0
ans = 0
for x in a:
    d = x // 2
    add = min(d, c)
    c -= add
    ans += add
    x -= add * 2
    ans += x // 3
    c += x % 3
print(ans)


n=int(input())
a=list(map(int,input().split()))
curr=0
two=1
tri=0
while curr<n:
    tri+=a[curr]//3
    a[curr]%=3
    while two<n-1 and (a[two]<2 or two<=curr):
        two+=1
    if a[curr]==1:
        if a[two]>=2 and two>curr:
            a[curr]-=1
            a[two]-=2
            tri+=1
    elif a[curr]==2:
        if a[two]>=2 and two>curr:
            a[curr]-=1
            a[two]-=2
            tri+=1
            while two<n-1 and (a[two]<2 or two<=curr):
                two+=1
            if a[two]>=2 and two>curr:
                a[curr]-=1
                a[two]-=2
                tri+=1
    curr+=1
print(tri)


n=int(input())
a=list(map(int,input().split()))
curr=0
two=0
tri=0
while curr<n:
    tri+=a[curr]//3
    a[curr]%=3
    while two<n-1 and (a[two]<2 or two<=curr):
        two+=1
    if a[curr]==1:
        if a[two]>=2 and two>curr:
            a[curr]-=1
            a[two]-=2
            tri+=1
    elif a[curr]==2:
        if a[two]>=2 and two>curr:
            a[curr]-=1
            a[two]-=2
            tri+=1
            while two<n-1 and (a[two]<2 or two<=curr):
                two+=1
            if a[two]>=2 and two>curr:
                a[curr]-=1
                a[two]-=2
                tri+=1
    curr+=1
print(tri)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
q = 0
y = 0
for x in a:
	if x % 3 == 0:
		q += 1
		y += 1
		ans += (x - 3) // 3
	elif x % 3 == 1:
		q += 1
		ans += x // 3
	else:
		y += 1
		ans += x // 3
ans += min(q, y)
t = min(q, y)
q, y = q - t, y - t
ans += (y // 3) * 2
y %= 3
ans += y // 2
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
q = 0
y = 0
for x in a:
	ans += max(0, x - 3) // 3
	if x % 3 == 0:
		q += 1
		y += 1
	elif x % 3 == 1:
		q += 1
	else:
		y += 1
ans += min(q, y)
t = min(q, y)
q, y = q - t, y - t
ans += (y // 3) * 2
y %= 3
ans += y // 2
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
q = 0
y = 0
for x in a:
	if x % 3 == 0:
		q += x // 3
		y += x // 3
	elif x % 3 == 1:
		q += x // 3 + 1
		y += x // 3
	else:
		y += x // 3 + 1
		q += x // 3
ans += min(q, y)
t = min(q, y)
q, y = q - t, y - t
ans += (y // 3) * 2
y %= 3
ans += y // 2
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
q = 0
y = 0
for x in a:
	ans += x // 3
	if x % 3 != 0:
		if x % 3 == 1:
			q += 1
		else:
			y += 1
ans += min(q, y)
t = min(q, y)
q, y = q - t, y - t
ans += (y // 3) * 2
y %= 3
ans += y // 2
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
q = 0
y = 0
for x in a:
	ans += x // 3
	if x % 3 == 0:
		q += 1
		y += 1
	elif x % 3 == 1:
		q += 1
	else:
		y += 1
ans += min(q, y)
t = min(q, y)
q, y = q - t, y - t
ans += (y // 3) * 2
y %= 3
ans += y // 2
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
cnt = 0
for x in a:
	cur = x // 2
	if cur <= cnt:
		ans += cur
		cnt -= cur
		if x % 2 == 1:
			cnt += 1
	else:
		ans += cnt
		ans += (x - 2 * cnt) // 3
		cnt = (x - 2 * cnt) % 3
print(ans)


from sys import stdin
n=int(stdin.readline().strip())
s=list(map(int,stdin.readline().strip().split()))
x=0
ans=0
for i in range(n):
    y=s[i]//2
    y1=min(y,x)
    s[i]-=y1*2
    x-=y1
    ans+=y1
    y=s[i]//3
    x+=s[i]-y*3
    s[i]-=y*3
    ans+=y
print(ans)


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    n = I()
    a = LI()

    r = 0
    ai = 0
    for i in range(n):
        if a[i] < 2:
            continue
        while ai < i:
            if a[ai] < 1:
                ai += 1
                continue
            if a[i] < 2:
                break
            r += 1
            a[ai] -= 1
            a[i] -= 2
        r += a[i] // 3
        a[i] %= 3

    return r

print(main())


import java.util.Arrays;
import java.util.Scanner;

public class Problem {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();
        String bumpers = scanner.nextLine();
        int[] f = new int[n];
        int min = 0;
        int max = n - 1;
        int s = 0;
        for (int i = 1; i < n; i++) {
            if (bumpers.charAt(i) == '<' && bumpers.charAt(i - 1) == '>') {
                f[i] = 1;
                f[i - 1] = 1;
            }
        }

        for (int i = 0; i < n; i++) {
            if (f[i] == 1) {
                min = i;
            }
        }

        for (int i = n - 1; i >= 0; i--) {
            if (f[i] == 1) {
                max = i;
            }
        }
        if (Arrays.stream(f).sum() == 0) {
            System.out.println(n);
            return;
        }

        for (int i = 0; i < n; i++) {
            if (bumpers.charAt(i) == '<' && i < min) {
                s++;
            }
        }

        for (int i = 0; i < n; i++) {
            if (bumpers.charAt(i) == '>' && i > max) {
                s++;
            }
        }
        System.out.println(s);

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Problem {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();
        String bumpers = scanner.nextLine();
        int[] f = new int[n];
        int min = 0;
        int max = n - 1;
        int s = 0;
        for (int i = 1; i < n; i++) {
            if (bumpers.charAt(i) == '<' && bumpers.charAt(i - 1) == '>') {
                f[i] = 1;
                f[i - 1] = 1;
            }
        }

        for (int i = 0; i < n; i++) {
            if (f[i] == 1) {
                min = i;
                break;
            }
        }

        for (int i = n - 1; i >= 0; i--) {
            if (f[i] == 1) {
                max = i;
                break;
            }
        }
        if (Arrays.stream(f).sum() == 0) {
            System.out.println(n);
            return;
        }

        for (int i = 0; i < n; i++) {
            if (bumpers.charAt(i) == '<' && i < min) {
                s++;
            }
        }

        for (int i = n - 1; i > 0; i--) {
            if (bumpers.charAt(i) == '>' && i > max) {
                s++;
            }
        }
        System.out.println(s);

    }
}


import java.io.*;
import java.util.*;

public class Main {
    static FastScanner in;
    static int n, ans = 0;
    static char s[];

    public static void main(String[] args) throws IOException {
        //        in = new FastScanner("input.txt");
        in = new FastScanner(System.in);
        n = in.nextInt();
        s = in.next().toCharArray();
        for (int i = 0; i < n; i++) {
            boolean fall = true;
            if (s[i] == '<') {
                for (int j = i; j >= 0; j--) {
                    if (s[j] != '<') {
                        fall = false;
                        break;
                    }
                }
            } else {
                for (int j = i; j < n; j++) {
                    if (s[j] != '>') {
                        fall = false;
                        break;
                    }
                }
            }
            if (fall)
                ans++;
        }
        System.out.println(ans);
    }
}

class FastScanner {

    BufferedReader br;
    StringTokenizer tokenizer;

    FastScanner(String fileName) throws FileNotFoundException {
        this(new FileInputStream(new File(fileName)));
    }

    FastScanner(InputStream is) {
        br = new BufferedReader(new InputStreamReader(is));
    }

    String nextLine() throws IOException {
        tokenizer = null;
        return br.readLine();
    }

    String next() throws IOException {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            tokenizer = new StringTokenizer(line);
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}


import java.io.*;
import java.util.*;

public class Main {
    static FastScanner in;
    static int n, ans = 0;
    static char s[];

    public static void main(String[] args) throws IOException {
        //        in = new FastScanner("input.txt");
        in = new FastScanner(System.in);
        n = in.nextInt();
        s = in.next().toCharArray();
        for (int i = 0; i < n; i++) {
            if (s[i] != '<') {
                break;
            }
            ans++;
        }
        for (int i = n - 1; i >= 0; i--) {
            if (s[i] != '>')
                break;
            ans++;
        }
        System.out.println(ans);
    }
}

class FastScanner {

    BufferedReader br;
    StringTokenizer tokenizer;

    FastScanner(String fileName) throws FileNotFoundException {
        this(new FileInputStream(new File(fileName)));
    }

    FastScanner(InputStream is) {
        br = new BufferedReader(new InputStreamReader(is));
    }

    String nextLine() throws IOException {
        tokenizer = null;
        return br.readLine();
    }

    String next() throws IOException {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            tokenizer = new StringTokenizer(line);
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}


package sample;

import java.util.Scanner;

public class CanadaA {
    public static void main (String[] args){
        Scanner scanner = new Scanner (System.in);
        int n  = scanner.nextInt();
        scanner.nextLine();
        String list =  scanner.nextLine();
        /*
        Find <
         */
        StringBuilder builder =  new StringBuilder(list);
        int i = 0 ;
        int count = builder.indexOf(">");
        i = count;
        if (count == -1){
            System.out.println (n);
            return;
        }
        int tempAdd= 0;
        while (i < n){
            if (builder.charAt(i) == '>') tempAdd++;
            else tempAdd = 0;
            i++;
        }
        System.out.println (count+tempAdd);
    }
}


import java.util.Scanner;

public class A {
    public static void main (String[] args){
        Scanner scanner = new Scanner (System.in);
        int n  = scanner.nextInt();
        scanner.nextLine();
        String list =  scanner.nextLine();
        /*
        Find <
         */
        StringBuilder builder =  new StringBuilder(list);
        int i = 0 ;
        int count = builder.indexOf(">");
        i = count;
        if (count == -1){
            System.out.println (n);
            return;
        }
        int tempAdd= 0;
        while (i < n){
            if (builder.charAt(i) == '>') tempAdd++;
            else tempAdd = 0;
            i++;
        }
        System.out.println (count+tempAdd);
    }
}


import java.util.Scanner;
//jump
public class JumpingBall {
    public static void main(String[] args)
    {
    	Scanner kbd = new Scanner(System.in);
    	int n = kbd.nextInt();
    	kbd.nextLine();
    	String s = kbd.nextLine();
    	System.out.print(Output(n,s));
    }
    public static int Output(int n,String s)
    {
        int l = 0;
        int r = 0;
        boolean isLeft = true;
        for (int i = 0; i < n; i++) {
            if (isLeft) {
                if (s.charAt(i) == '<') {
                    l++;
                } else {
                    isLeft = false;
                }
            }
            if (!isLeft) {
                if (s.charAt(i) == '>')
                    r++;
                else
                    r = 0;
            }
        }
        return l + r;
    }
}


import java.util.Scanner;
public class JumpingBall {
    public static void main(String[] args)
    {
    	Scanner kbd = new Scanner(System.in);
    	int n = kbd.nextInt();
    	kbd.nextLine();
    	String s = kbd.nextLine();
    	System.out.print(Output(n,s));
    }
    public static int Output(int n,String s)
    {
        int l = 0;
        int r = 0;
        boolean isLeft = true;
        for (int i = 0; i < n; i++) {
            if (isLeft) {
                if (s.charAt(i) == '<') {
                    l++;
                } else {
                    isLeft = false;
                }
            }
            if (!isLeft) {
                if (s.charAt(i) == '>')
                    r++;
                else
                    r = 0;
            }
        }
        return l + r;
    }
}


//725a
import java.util.Scanner;
public class JumpingBall {
    public static void main(String[] args)
    {
    	Scanner kbd = new Scanner(System.in);
    	int n = kbd.nextInt();
    	kbd.nextLine();
    	String s = kbd.nextLine();
    	System.out.print(Output(n,s));
    }
    public static int Output(int n,String s)
    {
        int l = 0;
        int r = 0;
        boolean isLeft = true;
        for (int i = 0; i < n; i++) {
            if (isLeft) {
                if (s.charAt(i) == '<') {
                    l++;
                } else {
                    isLeft = false;
                }
            }
            if (!isLeft) {
                if (s.charAt(i) == '>')
                    r++;
                else
                    r = 0;
            }
        }
        return l + r;
    }
}


import org.omg.CORBA.Current;

import java.util.Scanner;

public class A_004 {
    static char[] Bumpers;
    static int n;
    static int NPos = 0;
    static boolean IsEndClosed=false;
    static boolean IsBeginClosed=false;

    public static void main(String[] args) {
        Scanner SC = new Scanner(System.in);
        n = Integer.parseInt(SC.nextLine());
        Bumpers = SC.nextLine().toCharArray();
        int start=0;
        int end=n;

        if (Bumpers[0] == '<') {
            NPos++;
            start++;
        }
        else
        {
           IsBeginClosed=true;
        }
        if (Bumpers[Bumpers.length-1] == '>') {
            NPos++;
            end--;
        }
        else
        {
            IsEndClosed=true;
        }
        for (int Pos = start; Pos < end; Pos++) {
            try {
                Verify(Pos);
            } catch(Exception E) {
            }
        }
        System.out.println(NPos);
    }

    static void Verify(int CurrentPosition) throws Exception
    {
        if(CurrentPosition<0 || CurrentPosition>n-1)
        {
            NPos++;
            throw new Exception(" ");
        }
        else
        {
            if(Bumpers[CurrentPosition]=='<')
            {
                if(!IsBeginClosed) {
                    if ((CurrentPosition - 1) > 0 && Bumpers[CurrentPosition - 1] == '>')
                        throw new Exception("");
                    Verify(CurrentPosition - 1);
                }
                else
                {
                    throw new Exception();
                }
            }
            else
            {
                if(!IsEndClosed) {
                    if ((CurrentPosition + 1) < n - 1 && Bumpers[CurrentPosition + 1] == '<')
                        throw new Exception("");
                    Verify(CurrentPosition + 1);
                }
                else
                {
                    throw new Exception();
                }
            }
        }
    }
}


import org.omg.CORBA.Current;

import java.util.Scanner;

public class A_004 {
    static char[] Bumpers;
    static int n;
    static int NPos = 0;
    static int Entered=0;

    public static void main(String[] args) {
        Scanner SC = new Scanner(System.in);
        n = Integer.parseInt(SC.nextLine());
        Bumpers = SC.nextLine().toCharArray();
        int start=0;
        int end=n;

        if (Bumpers[0] == '<') {
            NPos++;
            start++;
        }
        if (Bumpers[Bumpers.length-1] == '>') {
            NPos++;
            end--;
        }
        for (int Pos = start; Pos < end; Pos++) {
            try {
                Verify(Pos);
            } catch(Exception E) {
            }
            Entered=0;
        }
        System.out.println(NPos);
    }

    static void Verify(int CurrentPosition) throws Exception
    {
        if(Entered>n)
            throw new Exception(" ");
        Entered++;
        if(CurrentPosition<0 || CurrentPosition>n-1)
        {
            NPos++;
            throw new Exception(" ");
        }
        else
        {
            if(Bumpers[CurrentPosition]=='<')
            {
                Verify(CurrentPosition-1);
            }
            else
            {
                Verify(CurrentPosition+1);
            }
        }
    }
}


import org.omg.CORBA.Current;

import java.util.Scanner;

public class A_004 {
    static char[] Bumpers;
    static int n;
    static int NPos = 0;
    static boolean IsEndClosed=false;
    static boolean IsBeginClosed=false;

    public static void main(String[] args) {
        Scanner SC = new Scanner(System.in);
        n = Integer.parseInt(SC.nextLine());
        Bumpers = SC.nextLine().toCharArray();

        int start=0;
        int end=n;

        try {
            if (Bumpers[0] == '<') {
                NPos++;
                start++;
                while (true) {
                    if (Bumpers[start] == '>')
                        break;
                    else {
                        start++;
                        NPos++;
                    }
                }
            }

            if (Bumpers[Bumpers.length - 1] == '>') {
                NPos++;
                end--;
                while (true) {
                    if (Bumpers[end] == '<')
                        break;
                    else {
                        end--;
                        NPos++;
                    }
                }
            }
        }
        catch(Exception E)
        {

        }

        System.out.println(NPos);
    }

//    static void Verify(int CurrentPosition) throws Exception
//    {
//        if(CurrentPosition<0 || CurrentPosition>n-1)
//        {
//            NPos++;
//            throw new Exception(" ");
//        }
//        else
//        {
//            if(Bumpers[CurrentPosition]=='<') {
//                if (IsBeginClosed || Bumpers[CurrentPosition-1]=='>')
//                    throw new Exception("");
//                Verify(CurrentPosition - 1);
//            }
//            else {
//                if (IsEndClosed || Bumpers[CurrentPosition+1]=='<')
//                    throw new Exception("");
//                Verify(CurrentPosition + 1);
//            }
//        }
//    }
}


import org.omg.CORBA.Current;

import java.util.Scanner;

public class A_004 {
    static char[] Bumpers;
    static int n;
    static int NPos = 0;
    static boolean IsEndClosed=false;
    static boolean IsBeginClosed=false;

    public static void main(String[] args) {
        Scanner SC = new Scanner(System.in);
        n = Integer.parseInt(SC.nextLine());
        Bumpers = SC.nextLine().toCharArray();

        int start=0;
        int end=n-1;

        try {
            if (Bumpers[0] == '<') {
                NPos++;
                start++;
                while (true) {
                    if (Bumpers[start] == '>')
                        break;
                    else {
                        start++;
                        NPos++;
                    }
                }
            }

            if (Bumpers[Bumpers.length - 1] == '>') {
                NPos++;
                end--;
                while (true) {
                    if (Bumpers[end] == '<')
                        break;
                    else {
                        end--;
                        NPos++;
                    }
                }
            }
        }
        catch(Exception E)
        {

        }

        System.out.println(NPos);
    }

//    static void Verify(int CurrentPosition) throws Exception
//    {
//        if(CurrentPosition<0 || CurrentPosition>n-1)
//        {
//            NPos++;
//            throw new Exception(" ");
//        }
//        else
//        {
//            if(Bumpers[CurrentPosition]=='<') {
//                if (IsBeginClosed || Bumpers[CurrentPosition-1]=='>')
//                    throw new Exception("");
//                Verify(CurrentPosition - 1);
//            }
//            else {
//                if (IsEndClosed || Bumpers[CurrentPosition+1]=='<')
//                    throw new Exception("");
//                Verify(CurrentPosition + 1);
//            }
//        }
//    }
}


import org.omg.CORBA.Current;

import java.util.Scanner;

public class A_004 {
    static char[] Bumpers;
    static int n;
    static int NPos = 0;

    public static void main(String[] args) {
        Scanner SC = new Scanner(System.in);
        n = Integer.parseInt(SC.nextLine());
        Bumpers = SC.nextLine().toCharArray();
        int start=0;
        int end=n;

        if (Bumpers[0] == '<') {
            NPos++;
            start++;
        }
        if (Bumpers[Bumpers.length-1] == '>') {
            NPos++;
            end--;
        }
        for (int Pos = start; Pos < end; Pos++) {
            try {
                Verify(Pos);
            } catch(Exception E) {
            }
        }
        System.out.println(NPos);
    }

    static void Verify(int CurrentPosition) throws Exception
    {
        if(CurrentPosition<0 || CurrentPosition>n-1)
        {
            NPos++;
            throw new Exception(" ");
        }
        else
        {
            if(Bumpers[CurrentPosition]=='<')
            {
                if((CurrentPosition-1)>0 && Bumpers[CurrentPosition-1]=='>')
                    throw new Exception("");
                Verify(CurrentPosition-1);
            }
            else
            {
                if((CurrentPosition+1)<n-1 && Bumpers[CurrentPosition+1]=='<')
                    throw new Exception("");
                Verify(CurrentPosition+1);
            }
        }
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
                l = 1;
                y = 1;
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {
                y -= l;
                l = c;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(Math.abs(k) );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
                l = 1;
                y = 1;
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {

                l = 0;
                y=0;
                continue;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(Math.abs(k) );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        long l = System.currentTimeMillis();
        int c = 0;
        int it = 0;
        int o=0;
        for (int i = 1; i <= n; i++) {
            it = i;
            o = i-1;
            for (int j = i-1; j < s.length(); j++) {
                if(s.charAt(o) == '<'){
                    it--;
                    o--;
                }
                else{
                    it++;
                    o++;
                }
                if(it<1 || it > n){
                    c++;
                    break;
                }
            }
        }
        System.out.println(c);

    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {
                y -= l;
                l = c;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(k );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
                l = 1;
                y = 1;
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {
                k -= y;
                l = 0;
                y=0;
                continue;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(Math.abs(k) );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {
                y -= l;
                l = c;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(Math.abs(k) );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
                l = 1;
                y = 1;
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {
                y -= l;
                l = 0;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(Math.abs(k) );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        int y = 0;
        int k = 0;
        int l = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                if (s.charAt(i) == '>') {
                    l++;
                    c++;
                    y++;
                }
                if (s.charAt(i) == '<') {
                    l--;
                    c--;
                    y--;
                }
                continue;
            }
            if (s.charAt(i) == '>' && s.charAt(i - 1) == '>') {
                l++;
                y++;
                c++;
            }
            if (s.charAt(i) == '<' && s.charAt(i - 1) == '<') {
                l--;
                y--;
                c--;
            }

            if (s.charAt(i) == '>' && s.charAt(i - 1) == '<') {
                k += Math.abs(y);
                y = 1;
            }
            if (s.charAt(i - 1) == '>' && s.charAt(i) == '<') {
                y -= l;
                l = c;
            }
            if(i == n-1 && i + y < 1){
                k +=y;
            }
            else if(i == n-1 && i + y > n){
                k+=y;
            }

        }

        System.out.println(Math.abs(k) );
    }
}


import java.util.Scanner;

public class P7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();
        int c = 0;
        for (int i = 0; i < n; i++) {
            if(s.charAt(i) == '<'){
                c++;
            }
            else break;
        }
        for (int i = n-1; i >= 0; i--) {
            if(s.charAt(i) == '>'){
                c++;
            }else break;
        }

        System.out.println(c);
    }
}


import java.io.*;
import java.util.*;
import java.util.regex.*;

public class codeforce {

    static Scanner sc = new Scanner(System.in);

    //static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintStream out=new PrintStream(System.out);
    //public static int mod = 1000000007;
    public static void main(String[] args) throws IOException {
        int n=sc.nextInt();
        String s=sc.next();

        int cnt=0;
        for(int i=0;i<n&&s.charAt(i)=='<';i++)cnt++;
        for(int i=n-1;i>=0&&s.charAt(i)=='>';i--)cnt++;
        out.println(cnt);
    }

}


import java.io.*;
import java.util.*;
import java.util.regex.*;

public class codeforce {

    static Scanner sc = new Scanner(System.in);

    //static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintStream out=new PrintStream(System.out);
    //public static int mod = 1000000007;
    public static void main(String[] args) throws IOException {
        int n=sc.nextInt();
        String s=sc.next();
        int len=s.length();
        int cnt=0;
        for(int i=0;i<len;i++){
            if(s.charAt(i)=='<')cnt--;
            else cnt++;
        }
        out.println(Math.abs(cnt));
    }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class A {

	public static void main(String[] args) throws Exception {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String l[] = bf.readLine().split(" ");
		int n = Integer.parseInt(l[0]);
		char s[] = bf.readLine().toCharArray();
		boolean start = false;
		boolean end = false;
		int count = 0, ans = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == '>') {
				if (start && !end) {
					count++;
				} else if (!start || end) {
					start = true;
					ans += count;
					count = 1;
				}
			} else {
				if (end) {
					count++;
				} else if (start) {
					start = false;
					end = true;
					count++;
				}
			}
		}
		if (end)
			ans += count;
		System.out.println(n - ans);
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class A {

	public static void main(String[] args) throws Exception {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String l[] = bf.readLine().split(" ");
		int n = Integer.parseInt(l[0]);
		char s[] = bf.readLine().toCharArray();
		int ans = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == '<') {
				ans++;
			} else {
				break;
			}
		}
		for (int i = n - 1; i >= 0; i--) {
			if (s[i] == '>')
				ans++;
			else
				break;
		}
		System.out.println(ans);
	}
}


import java.util.Scanner;

public class Q1 {

	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int n=sc.nextInt();
		String s = sc.next();
		int pos=0;
		for(int i=0;i<n;i++){
			if(s.charAt(i)=='<')
				pos++;
			else
				break;
		}
		for(int i=n-1;i>=0;--i){
			if(s.charAt(i)=='>')
				pos++;
			else
				break;
		}
		System.out.println(pos);
		sc.close();
	}
}


import java.util.*;
public class A725
{
	public static void main(String...arg)
	{
		int n,i,j,c=0,m=0,d=0;
		Scanner sc =new Scanner(System.in);
		n=sc.nextInt();
		sc.nextLine();
		String s=sc.nextLine();
		char a[]=new char[n];
		for(i=0;i<n;i++)
		{
			a[i]=s.charAt(i);
		}
		for(i=1;i<n;i++)
		{

			if(a[i]=='<')
			{
				for(j=i-1;j>=0;j--)
				{
					if(a[j]=='>')
					{
						c=1;
						break;
					}
					else
						c=0;
				}
				if(c==0)
					m++;
				c=0;
				d=1;
			}
		}
		if(a[0]=='<')
			m++;
		if(a[n-1]=='>')
			m++;

		if(d==0)
			m=n;
		System.out.println(m);
	}
}


import java.util.*;
public class A725
{
	public static void main(String...arg)
	{
		int n,i,j,c=0,m=0,d=0,e=0;
		Scanner sc =new Scanner(System.in);
		n=sc.nextInt();
		sc.nextLine();
		String s=sc.nextLine();
		char a[]=new char[n];
		for(i=0;i<n;i++)
		{
			a[i]=s.charAt(i);
		}
		for(i=1;i<n;i++)
		{

			if(a[i]=='>')
				e=1;
			if(a[i]=='<')
			{
				for(j=i-1;j>=0;j--)
				{
					if(a[j]=='>')
					{
						c=1;
						break;
					}
					else
						c=0;
				}
				if(c==0)
					m++;
				c=0;
				d=1;
			}
		}
		if(a[0]=='<')
			m++;
		if(a[n-1]=='>')
			m++;

		if(d==0||e==0)
			m=n;
		System.out.println(m);
	}
}


import java.util.*;
public class A725
{
	public static void main(String...arg)
	{
		int n,i,j,c=0,m=0,d=0,e=0;
		Scanner sc =new Scanner(System.in);
		n=sc.nextInt();
		sc.nextLine();
		String s=sc.nextLine();
		char a[]=new char[n];
		for(i=0;i<n;i++)
		{
			a[i]=s.charAt(i);
		}
		for(i=0;i<n;i++)
		{

			if(a[i]=='>')
				e=1;
			if(a[i]=='<')
			{
				if(i!=0)
				{
				for(j=i-1;j>=0;j--)
				{
					if(a[j]=='>')
					{
						c=1;
						break;
					}
					else
						c=0;
				}
				if(c==0)
					m++;

				c=0;}
				d=1;
			}
		}
		if(a[0]=='<')
			m++;
		if(a[n-1]=='>')
			m++;

		if(d==0||e==0)
			m=n;
		System.out.println(m);
	}
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class A {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	static class sort implements Comparable<sort> {
		int a, b;

		public sort(int a, int b) {
			this.a = a;
			this.b = b;
		}

		public int compareTo(sort arg0) {
			return (this.a - arg0.a);
		}
	}
	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));

		int n = nextInt();
		char b[] = next().toCharArray();
		int ans = 0;

		for (int i = 0; i < b.length; i++) {
			boolean h = false;
			if(b[i] == '<'){
				for (int j = 0; j < i; j++) {
					if(b[j] == '>')
						h = true;
				}
				if(!h)
					ans ++;
			} else {
				for (int j = i+1; j < b.length; j++) {
					if(b[j] == '<')
						h = true;
				}
				if(!h)
					ans ++;
			}
		}

		pw.print(ans);
		pw.close();
	}

	private static void gfile() throws IOException {
		br = new BufferedReader(new FileReader(new File("input.txt")));
		pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(
				"output.txt"))));
	}

	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	private static String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class A {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	static class sort implements Comparable<sort> {
		int a, b;

		public sort(int a, int b) {
			this.a = a;
			this.b = b;
		}

		public int compareTo(sort arg0) {
			return (this.a - arg0.a);
		}
	}
	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));

		int n = nextInt();
		char b[] = next().toCharArray();
		int ans = 0;

		for (int i = 0; i < b.length; i++) {
			if(b[i] == '<')
				ans ++;
			else
				break;
		}

		for (int i = n-1; i >=0; i--) {
			if(b[i] == '>')
				ans ++;
			else
				break;
		}

		pw.print(ans);
		pw.close();
	}

	private static void gfile() throws IOException {
		br = new BufferedReader(new FileReader(new File("input.txt")));
		pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(
				"output.txt"))));
	}

	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	private static String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class A {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	static class sort implements Comparable<sort> {
		int a, b;

		public sort(int a, int b) {
			this.a = a;
			this.b = b;
		}

		public int compareTo(sort arg0) {
			return (this.a - arg0.a);
		}
	}
	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));

		int n = nextInt();
		char b[] = next().toCharArray();
		int l = 0, r = 0;

		for (int i = 0; i < b.length; i++) {
			if(b[i] == '<')
				l++;
			else r++;
		}

		pw.print(Math.abs(r-l));
		pw.close();
	}

	private static void gfile() throws IOException {
		br = new BufferedReader(new FileReader(new File("input.txt")));
		pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(
				"output.txt"))));
	}

	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	private static String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}


//package CanandaCup_CodeForces;

import java.util.Scanner;

public class A_JumpingBall {
	static int N;
	static String str;
	static int maxCount;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		str = sc.next();
		int c = 0;
		for (int i = 0; i < N && str.charAt(i) == '<'; i++) {
			c++;
		}
		for (int i = N - 1; i >= 0 && str.charAt(i) == '>'; i--) {
			c++;
		}
		System.out.println(c);
	}
}


//package CanandaCup_CodeForces;

import java.util.Scanner;

public class A_JumpingBall {
	static int N;
	static String str;
	static int maxCount;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		str = sc.next();
		int LEFT = 1, RIGHT = 2;
		int DIR = 0;
		maxCount = Integer.MIN_VALUE;
		for (int i = 0; i < N; i++) {
			int cnt = 0;
			if (str.charAt(i) == '<') {
				DIR = LEFT;
			} else {
				DIR = RIGHT;
			}
			int j = i;
			boolean vis[] = new boolean[N];
			while (j >= 0 && j < N && !vis[j]) {
				if (DIR == LEFT) {
					if (str.charAt(j) == '<') {
						cnt++;
						vis[j] = true;
						j--;
					} else {
						j++;
					}
				} else {
					if (str.charAt(j) == '>') {
						cnt++;
						vis[j] = true;
						j++;
					} else {
						j--;
					}
				}
			}
			//System.out.println(j);
			if ((j < 0 || j >= N) && maxCount < cnt) {
				maxCount = cnt;
			}
		}
		if (maxCount == Integer.MIN_VALUE) {
			System.out.println("0");
		} else {
			System.out.println(maxCount);
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.lang.*;
import java.util.*;

public class Stub
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args)
    {
		FastReader sc=new FastReader();
	//////////////////////////////////////////////////////
	int n=sc.nextInt(),a=0,b=0,i=0;
	String s=sc.next();
	while(i<n&&s.charAt(i)=='<')
	{
		a++;
		i++;
	}
	i=n-1;
	while(i>=0&&s.charAt(i)=='>')
	{
		a++;
		i--;
	}

		System.out.print(a);

	//////////////////////////////////////////////////////
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.lang.*;
import java.util.*;

public class Stub
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args)
    {
		FastReader sc=new FastReader();
	//////////////////////////////////////////////////////
	int n=sc.nextInt(),a=0,b=0,i=0;
	String s=sc.next();
	while(i<n&&s.charAt(i)=='<')
	{
		a++;
		i++;
	}
	i=n-1;
	while(i>=0&&s.charAt(i)=='<')
	{
		a++;
		i--;
	}

		System.out.print(a);

	//////////////////////////////////////////////////////
	}
}


import java.util.*;
import java.io.*;
import static java.lang.System.*;

public class A725 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(in);
        int n = sc.nextInt(); sc.nextLine();
        int pos = 0;
        char[]bumps = sc.nextLine().toCharArray();
        for(int i = 0; i < n; i++){
            if(bumps[i] == '>' || pos == n)
                break;
            pos++;
        }

        for(int i = n-1; i >= 0; i--){
            if(bumps[i] == '<' || pos == n)
                break;
            pos++;
        }

        out.printf("%d\n",pos);
    }
}


import java.util.*;
import java.io.*;
import static java.lang.System.*;

public class A725 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(in);
        int n = sc.nextInt(); sc.nextLine();
        int pos = 0;
        String[]bumps = sc.nextLine().split("");
//        out.println(Arrays.toString(bumps));
        for(int i = 1; i < n+1; i++){
            if(bumps[i].charAt(0) == '<')
                pos++;
            else
                pos--;
        }

        out.println(Math.abs(pos));
    }
}


import java.util.*;
import java.io.*;
import static java.lang.System.*;

public class A725 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(in);
        int n = sc.nextInt(); sc.nextLine();
        int pos = 0;
        char[]bumps = sc.nextLine().toCharArray();
//        out.println(Arrays.toString(bumps));
        for(int i = 0; i < n; i++){
            if(bumps[i] == '<')
                pos++;
            else
                pos--;
        }

        out.println(Math.abs(pos));
    }
}


/*
 *24/10/2016
 *1:40 AM
 * author: AbdEl-Rahman Naser
 */
 import java.util.Scanner;
public class JBall
{
    //that moment when your internet goes out when you're about to submit the correct solution

	public static void main(String[] args)
	{
		   Scanner cin=new Scanner(System.in);
         int x=cin.nextInt(),counter=0;
         String s=cin.next();
         for(int i=0;i<s.length()-1;i++)
        	 if(s.charAt(i)=='<')
        		 counter++;
        	 else break;
         for(int t=s.length()-1;t>=0;t--)
	if(s.charAt(t)=='>')
		 counter++;
	else break;
     	System.out.println(counter);

	}
}


/*
 *24/10/2016
 *1:40 AM
 * author: AbdEl-Rahman Naser
 */
 import java.util.Scanner;
public class JBall
{
    //that moment when your internet goes out when you're about to submit the correct solution

	public static void main(String[] args)
	{
		   Scanner cin=new Scanner(System.in);
         int x=cin.nextInt(),counter=0;
         String s=cin.next();
         for(int i=0;i<s.length();i++)
        	 if(s.charAt(i)=='<')
        		 counter++;
        	 else break;
         for(int t=s.length()-1;t>=0;t--)
	if(s.charAt(t)=='>')
		 counter++;
	else break;
     	System.out.println(counter);

	}
}


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner s = new Scanner(System.in);
		int t, index = 0;

		t = s.nextInt();
		char ch[] = (s.next()).toCharArray();
		for (int i = 0; i < t && ch[i] == '<'; i++) {
			index++;

		}

		for (int i = t-1; i >= 0 && ch[i] == '>'; i--) {
			index--;

		}
		System.out.println(Math.abs(index));

	}// main

}


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner s = new Scanner(System.in);
		int t, index = 0;

		t = s.nextInt();
		char ch[] = (s.next()).toCharArray();
		for (int i = 0; i < t && ch[i] == '<'; i++) {
			index++;

		}

		for (int i = t-1; i >= 0 && ch[i] == '>'; i--) {
			index++;

		}
		System.out.println(index);

	}// main

}


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner s = new Scanner(System.in);
		int t, index = 0;

		 t  =s.nextInt();
		 char ch [] = (s.next()).toCharArray();
		for (int i = 0; i < t; i++){
			if (ch[i] == '>'){
				index++;
			}
			else{
				index--;
			}

		}

		System.out.println(Math.abs(index));

	}// main

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        try {
            int n = Integer.parseInt(br.readLine());
            String line = br.readLine();
            int leftBound = -1;
            int rightBound = n;

            for (int i = 0 ; i < n ; i ++) {
                if (line.charAt(i) == '>') {
                    leftBound = i;
                    break;
                }
            }

            for (int i = n - 1 ; i >= 0 ; i --) {
                if (line.charAt(i) == '<') {
                    rightBound = i;
                    break;
                }
            }

            if ((leftBound > rightBound) || (leftBound == -1) || (rightBound == n)) {
                System.out.println(n);
            }
            else {
                System.out.println(n - (rightBound - leftBound + 1));
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {
    private static final String INPUT_FILE = "inp.txt";
    private static final String OUTPUT_FILE = "out.txt";
    private static FastReader in;
    private static PrintWriter out;

    static class Solver {
        void run() {
            int n = in.nextInt();
            String s = in.next();
            int res = 0;
            for (int i = 0; i < n; i++) {
                if (s.charAt(i) == '<') res++;
                else break;
            }
            for (int i = n - 1; i >= 0; i--) {
                if (s.charAt(i) == '>') res++;
                else break;
            }
            out.println(res);
        }
    }

    public static void main(String[] args) {
        //initFiles();
        initStandard();
        (new Solver()).run();
        out.close();
    }

    private static void initStandard() {
        in = new FastReaderImpl(System.in);
        out = new PrintWriter(System.out);
    }

    private static void initFiles() {
        try {
            File inputFile = new File(INPUT_FILE);
            InputStream inputStream = new FileInputStream(inputFile);
            in = new FastReaderImpl(inputStream);
            out = new PrintWriter(OUTPUT_FILE);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
    }

    interface FastReader {
        String next();

        String nextLine();

        int nextInt();

        long nextLong();

        double nextDouble();
    }

    static class FastReaderImpl implements FastReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public FastReaderImpl(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        @Override
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        @Override
        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public int nextInt() {
            return Integer.parseInt(next());
        }

        @Override
        public long nextLong() {
            return Long.parseLong(next());
        }

        @Override
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.util.Scanner;

/* Created by vietlam on 10/25/16. */
public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.nextLine();
        s = sc.nextLine();
        int res = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '<') res++;
            else break;
        }
        for (int i = n - 1; i >= 0; i--) {
            if (s.charAt(i) == '>') res++;
            else break;
        }
        System.out.println(res);
    }
}


package com.lamphanviet.canadacup2016;

import java.util.Scanner;

/* Created by vietlam on 10/25/16. */
public class A {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int res = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '<') res++;
            else break;
        }
        for (int i = n - 1; i >= 0; i--) {
            if (s.charAt(i) == '>') res++;
            else break;
        }
        System.out.println(res);
    }
}


package com.lamphanviet.canadacup2016;

import java.util.Scanner;

/* Created by vietlam on 10/25/16. */
public class A {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.nextLine();
        s = sc.nextLine();
        int res = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '<') res++;
            else break;
        }
        for (int i = n - 1; i >= 0; i--) {
            if (s.charAt(i) == '>') res++;
            else break;
        }
        System.out.println(res);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.math.BigInteger;
 public class fall
 {
	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
	public static void main(String args[])
	{
		FastReader s=new FastReader();
		int n=s.nextInt();
		String ss=s.next();
		char a[]=new char[n];

		int co1=0;
		int co2=0;
		int d=0;

		int t=0;
	 int v=0;
		for(int i=0;i<n;i++)
		{
			a[i]=ss.charAt(i);
			if(  a[i]=='>')
			{

				co1++;
				v=1;
			}
			if(a[i]=='<' && v!=1 )
			{
				co2++;

			}

			if(a[i]=='<' && v==1)
			{
				d=1;
			}
			if(d==1)
			{
				co1=0;
			}

		}
		System.out.println(co1+co2);

	}
 }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.math.BigInteger;
 public class fall
 {
	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
	public static void main(String args[])
	{
		FastReader s=new FastReader();
		int n=s.nextInt();
		String ss=s.next();
		char a[]=new char[n];

		int co1=0;
		int co2=0;
		int d=0;

		int t=0;
	 int v=0;
		for(int i=0;i<n;i++)
		{
			a[i]=ss.charAt(i);
			if(  a[i]=='>')
			{

				co1++;
				v=1;
			}
			if(a[i]=='<' && v!=1 )
			{
				co2++;

			}

			if(a[i]=='<' && v==1)
			{
				d=1;
			}
			if(d==1)
			{
				co1=0;
				d=0;
			}

		}
		System.out.println(co1+co2);

	}
 }


import java.awt.List;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;

public class Main {

	public static void main(String[] args) {
		  	FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out);
			int n =sc.nextInt();
			String str =sc.nextToken();int x=0;
			for(int i=0;i<n;i++){
			    if(str.charAt(i)=='<')
				x++;
			    else
				break;
			}
			for(int i=n-1;i>=0;i--){
			    if(str.charAt(i)=='>')
				x++;
			    else
				break;
			}

			System.out.println(x);

	}

	static void generate(int[] p, int L, int R) {
		  if (L == R) {
			  //the permutation is here ya omar(base case)

		  }else {
		    for (int i = L; i <= R; i++) {
		    	int tmp = p[L]; p[L] = p[i]; p[i] = tmp;//swap
		      generate(p, L+1, R);//recurse
		      tmp = p[L]; p[L] = p[i]; p[i] = tmp;//unswap

		    }
		  }
		}

}

class FastScanner {

    BufferedReader br;
    StringTokenizer st;

    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {

                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
}


import java.awt.List;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;

public class Main {

	public static void main(String[] args) {
		  	FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out);
			int n =sc.nextInt();
			Stack <Character>st = new Stack();
			String str =sc.nextToken();
			for(int i=0;i<n;i++)
			{
			    if(!st.isEmpty() && str.charAt(i)=='<' && st.peek()=='>' && st.size()!=0)
				st.pop();
			    else
				st.push(str.charAt(i));
			}
			    System.out.println(st.size());

	}

	static void generate(int[] p, int L, int R) {
		  if (L == R) {
			  //the permutation is here ya omar(base case)

		  }else {
		    for (int i = L; i <= R; i++) {
		    	int tmp = p[L]; p[L] = p[i]; p[i] = tmp;//swap
		      generate(p, L+1, R);//recurse
		      tmp = p[L]; p[L] = p[i]; p[i] = tmp;//unswap

		    }
		  }
		}

}

class FastScanner {

    BufferedReader br;
    StringTokenizer st;

    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {

                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
}


import java.awt.List;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;

public class Main {

	public static void main(String[] args) {
		  	FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out);
			int n =sc.nextInt();
			Stack <Character>st = new Stack();
			String str =sc.nextToken();
			for(int i=0;i<n;i++)
			{
			    if(!st.isEmpty() && str.charAt(i)=='<' && st.peek()=='>' && st.size()!=0)
				st.pop();
			    else
				st.push(str.charAt(i));
			}
			    System.out.println(st.size());

	}

	static void generate(int[] p, int L, int R) {
		  if (L == R) {
			  //the permutation is here ya omar(base case)

		  }else {
		    for (int i = L; i <= R; i++) {
		    	int tmp = p[L]; p[L] = p[i]; p[i] = tmp;//swap
		      generate(p, L+1, R);//recurse
		      tmp = p[L]; p[L] = p[i]; p[i] = tmp;//unswap

		    }
		  }
		}

	@Override
	public int compare(Main o1, Main o2) {
	    if(o1.x>o2.x)
		return 1;
	    if(o1.x<o2.x)
		return -1;
	    if(o1.x==o2.x)
		return 0;
	    return 0;
	}

}

class FastScanner {

    BufferedReader br;
    StringTokenizer st;

    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {

                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
}


import java.awt.List;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;

public class Main <Main>{

	public static void main(String[] args) {
		  	FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out);
			int n =sc.nextInt();
			Stack <Character>st = new Stack();
			String str =sc.nextToken();
			for(int i=0;i<n;i++)
			{
			    if(!st.isEmpty() && str.charAt(i)=='<' && st.peek()=='>' && st.size()!=0)
				st.pop();
			    else
				st.push(str.charAt(i));
			}
			    System.out.println(st.size());

	}

	static void generate(int[] p, int L, int R) {
		  if (L == R) {
			  //the permutation is here ya omar(base case)

		  }else {
		    for (int i = L; i <= R; i++) {
		    	int tmp = p[L]; p[L] = p[i]; p[i] = tmp;//swap
		      generate(p, L+1, R);//recurse
		      tmp = p[L]; p[L] = p[i]; p[i] = tmp;//unswap

		    }
		  }
		}

	@Override
	public int compare(Main o1, Main o2) {
	    if(o1.x>o2.x)
		return 1;
	    if(o1.x<o2.x)
		return -1;
	    if(o1.x==o2.x)
		return 0;
	    return 0;
	}

}

class FastScanner {

    BufferedReader br;
    StringTokenizer st;

    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {

                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class CodeForces {
    private final BufferedReader reader;
    private final PrintWriter writer;
    private StringTokenizer tokenizer;

    private void solve() {
        int n = nextInt();
        char[] chars = next().toCharArray();
        long res = 0;
        for (int i = 0; i < n; i++) {
            if (chars[i] == '<') res++;
            else break;
        }
        for (int i = n - 1; i >= 0; i--) {
            if (chars[i] == '>') res++;
            else break;
        }
        writer.print(res);
    }

    public static void main(String[] args) {
        new CodeForces(System.in, System.out);
    }

    private CodeForces(InputStream inputStream, OutputStream outputStream) {
        this.reader = new BufferedReader(new InputStreamReader(inputStream));
        this.writer = new PrintWriter(outputStream);
        solve();
        writer.close();
    }

    private String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(readLine());
        }
        return tokenizer.nextToken();
    }

    private String readLine() {
        String line;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return line;
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private long nextLong() {
        return Long.parseLong(next());
    }

    private double nextDouble() {
        return Double.parseDouble(next());
    }

    public boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = readLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

    public static int upperBinarySearch(int[] array, int start, int finish, int key) {
        int low = 0;
        int high = array.length - 1;
        if (high < 0) return -1;
        while (low < high) {
            int mid = (low + high + 1) >>> 1;
            if (array[mid] <= key) low = mid;
            else high = mid - 1;
        }
        if (array[low] != key) {
            if (array[low] < key) low++;
            low = -(low + 1);
        }
        return low;
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class CodeForces {
    private final BufferedReader reader;
    private final PrintWriter writer;
    private StringTokenizer tokenizer;

    private void solve() {
        int n = nextInt();
        String input = next();
        int[] count = new int[n];
        StringBuilder res = new StringBuilder();
        for (int i = 0, j = 0; i < n; i++) {
            if (i == 0) {
                res.append(input.charAt(i));
                count[j]++;
            } else {
                if (res.charAt(j) != input.charAt(i)) {
                    j++;
                    res.append(input.charAt(i));
                }
                count[j]++;
            }
        }
        for (int i = 1; i < res.length(); i++) {
            if (res.charAt(i) == '<' && res.charAt(i - 1) == '>') {
                res.delete(i - 1, i + 1);
                count[i] = 0;
                count[i - 1] = 0;
            }
        }
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += count[i];
        }
        writer.print(sum);
    }

    public static void main(String[] args) {
        new CodeForces(System.in, System.out);
    }

    private CodeForces(InputStream inputStream, OutputStream outputStream) {
        this.reader = new BufferedReader(new InputStreamReader(inputStream));
        this.writer = new PrintWriter(outputStream);
        solve();
        writer.close();
    }

    private String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(readLine());
        }
        return tokenizer.nextToken();
    }

    private String readLine() {
        String line;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return line;
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private long nextLong() {
        return Long.parseLong(next());
    }

    private double nextDouble() {
        return Double.parseDouble(next());
    }

    public boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = readLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

    public static int upperBinarySearch (int[] array, int start, int finish, int key) {
        int low = 0;
        int high = array.length- 1;
        if (high < 0) return -1;
        while (low < high) {
            int mid = (low + high + 1) >>> 1;
            if (array[mid] <= key) low = mid;
            else high = mid - 1;
        }
        if (array[low] != key) {
            if (array[low] < key) low++;
            low = -(low + 1);
        }
        return low;
    }
}


import java.util.Scanner;

public class Main  {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String string = sc.next();
        jumpingBall(n, string);
    }

    private static void jumpingBall(int n,String str) {

        int count = 0;
        Boolean firstDone = false;
        Boolean lastDone = false;
        for (int i=0; i<n;i++) {
            if (str.charAt(i) == '<' && !firstDone) {
                count++;
            } else
                firstDone = true;
            if (str.charAt(n-i-1) == '>' && !lastDone)
                count++;
            else
                lastDone = true;
        }

        System.out.println(count);
    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Integer.*;

public class Solution {

    class Pair<F, S> implements Serializable {
        F first;
        S second;

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }

        public Pair() {

        }

        @Override
        public String toString() {
            return first + " " + second;
        }

        @Override
        public int hashCode() {
            return first.hashCode() * 13 + (second == null ? 0 : second.hashCode());
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj) return true;
            if (obj instanceof Pair) {
                Pair pair = (Pair) obj;
                if (first != null ? !first.equals(pair.first) : pair.first != null) return false;
                if (second != null ? !second.equals(pair.second) : pair.second != null) return false;
                return true;
            }
            return false;
        }
    }

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);
    StringTokenizer stringTokenizer;
    Scanner scan = new Scanner(System.in);

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                throw new IOException();
            }

            stringTokenizer = new StringTokenizer(line);
        }
        return stringTokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String... args) throws IOException {
        new Solution().run();
    }

    private void run() throws IOException {
        int n = scan.nextInt();
        String s = scan.next();
        char[] a = s.toCharArray();

        int count = 0;

        for (int i = 0; i < s.length(); i++) {
            if (i >= 0 && i < s.length() - 1 && s.charAt(i) == '>' && s.charAt(i + 1) == '<') {
                s = s.substring(0, i) + s.substring(i + 2, s.length());
                count += 2;
                i -= 2;
                //System.out.println(s);
            }
        }
        System.out.println(n - count);

    }

}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Integer.*;

public class Solution {

    class Pair<F, S> implements Serializable {
        F first;
        S second;

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }

        public Pair() {

        }

        @Override
        public String toString() {
            return first + " " + second;
        }

        @Override
        public int hashCode() {
            return first.hashCode() * 13 + (second == null ? 0 : second.hashCode());
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj) return true;
            if (obj instanceof Pair) {
                Pair pair = (Pair) obj;
                if (first != null ? !first.equals(pair.first) : pair.first != null) return false;
                if (second != null ? !second.equals(pair.second) : pair.second != null) return false;
                return true;
            }
            return false;
        }
    }

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);
    StringTokenizer stringTokenizer;
    Scanner scan = new Scanner(System.in);

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                throw new IOException();
            }

            stringTokenizer = new StringTokenizer(line);
        }
        return stringTokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String... args) throws IOException {
        new Solution().run();
    }

    private void run() throws IOException {
        int n = scan.nextInt();
        String s = scan.next();

        int l = 0, r = 0;
        boolean lf = false, rf = false;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '>') {
                l = i;
                lf = true;
                break;
            }
        }
        for (int i = s.length() - 1; i >= 0; i--) {
            if (s.charAt(i) == '<') {
                r = i;
                rf = true;
                break;
            }
        }

        System.out.println(n - (rf && lf ? Math.abs(r - l + 1) : 0));

    }

}


import java.util.*;

public class main {
    public String str;
    public int n;

    main()
    {
        Scanner input = new Scanner(System.in);
        n = input.nextInt();
        input.nextLine();
        str = input.nextLine();
    }

    public boolean willStay(int n){
        if (n == 0)
        {
            if (str.charAt(0) == '<')
                return false;
            else
                return willStay(n + 1);
        }
        if (n == str.length() - 1)
        {
            if (str.charAt(n) == '>')
                return false;
            else
                return willStay(n - 1);
        }

        if (str.charAt(n) == '<' && str.charAt(n - 1) == '>')
            return true;
        if (str.charAt(n) == '>' && str.charAt(n + 1) == '<')
            return true;

        return str.charAt(n) == '<' ? willStay(n - 1) : willStay(n + 1);
    }

    public void sol()
    {
        if (str.length() == 1)
            System.out.println(1);
        else if (str.length() == 2)
        {
            if (str.charAt(0) == str.charAt(1))
                System.out.println(2);
            else
            {
                if (str.charAt(0) == '>')
                    System.out.println(0);
                else
                    System.out.println(2);
            }
        }
        else
        {
            int res = 0;
            for (int i = 0; i < n; i++)
            {
                if (willStay(i) == false)
                    res++;
            }

            System.out.println(res);
        }

    }

    public static void main(String[] args) {
        main prob = new main();
        prob.sol();

    }
}


import java.util.*;

public class main {
    public String str;
    public int n;

    main()
    {
        Scanner input = new Scanner(System.in);
        n = input.nextInt();
        input.nextLine();
        str = input.nextLine();
    }

    public void process()
    {
        int left = 0;
        int right = str.length() - 1;

        while (left < str.length() && str.charAt(left) == '<')
        {
            left++;
        }

        int index = 0;

        while (right >= 0 && str.charAt(right) == '>')
        {
            index++;
            right--;
        }

        right = index;

        System.out.println(right + left);
    }
    public static void main(String[] args) {
        main prob = new main();
        prob.process();

    }
}


import java.util.*;

public class main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        input.nextLine();
        String str = input.nextLine();
        int rise = 0;
        for (int i = 0; i < str.length(); i++)
        {
            if (str.charAt(i) == '>')
                rise++;
            else
                rise--;
        }

        System.out.println(Math.abs(rise));
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Solution {
    public static void main(String[] args) throws IOException {
        MyScanner.init(System.in);
        int n = MyScanner.nextInt();
        String in = MyScanner.nextLine();
        assert in.length() == n;

        int count = 0;
        for(int i = 0; i< n; i++) {
            if(solveItr(in, i)){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean solveItr(String in, int i) {
        int last = -10;
        while((i >= 0 && i < in.length()) && (last != i)) {
            int temp = i;
            if(in.charAt(i) == '<') {
                i--;
            } else {
                i++;
            }
            if(last == i) {
                return false;
            } else {
                last = temp;
            }
        }
        if(i < 0 || i >= in.length()){
            return true;
        } else {
            return false;
        }
    }

    private static void reset(boolean[] v) {
        for (int i = 0; i< v.length; i++) {
            v[i] = false;
        }
    }

    static class MyScanner {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        public static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                // TODO add check for eof if necessary
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static String nextLine() throws IOException {
            return reader.readLine();
        }

        public static int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public static long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Solution {
    public static void main(String[] args) throws IOException {
        MyScanner.init(System.in);
        int n = MyScanner.nextInt();
        String in = MyScanner.nextLine();
        assert in.length() == n;
        boolean v[] = new boolean[in.length()];

        int count = 0;
        for(int i = 0; i< n; i++) {
            reset(v);
            if(solve(in, i, v)){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean solve(String in, int i, boolean[] v) {
        if(i < 0 || i >= in.length()){
            return true;
        }
        if(v[i]){
            return false;
        } else {
            v[i] = true;
            if(in.charAt(i) == '<'){
                return solve(in, i-1, v);
            } else {
                return solve(in, i+1, v);
            }
        }
    }

    private static void reset(boolean[] v) {
        for (int i = 0; i< v.length; i++) {
            v[i] = false;
        }
    }

    static class MyScanner {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        public static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                // TODO add check for eof if necessary
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static String nextLine() throws IOException {
            return reader.readLine();
        }

        public static int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public static long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;

public class Solution {
    static int count = 0;
    public static void main(String[] args) throws IOException {
        MyScanner.init(System.in);
        int n = MyScanner.nextInt();
        String in = MyScanner.nextLine();
        assert in.length() == n;

        int count = solve(in);
        System.out.println(count);
    }

    private static int solve(String in) {
        List<String> stack = new LinkedList<>();
        for(int i =0; i< in.length(); i++){
            if(stack.isEmpty()){
                stack.add(String.valueOf(in.charAt(i)));
            } else {
                if(stack.get(stack.size() -1).equals(String.valueOf(in.charAt(i)))){
                    stack.add(String.valueOf(in.charAt(i)));
                } else {
                    stack.remove(stack.size()-1);
                }
            }
        }
        return stack.size();
    }

    static class MyScanner {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        public static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                // TODO add check for eof if necessary
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static String nextLine() throws IOException {
            return reader.readLine();
        }

        public static int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public static long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}