def solve(n, a, s): a = a + a t = [] for i in range(2 * n - 1): if a[i] < a[i + 1]: t.append('<') else: t.append('>') t = ''.join(t) return t.find(s) n = int(input()) a = list(map(int,input().split())) s = input() print(solve(n, a, s))