Harryxun/stf_run huggingface dataset:
import numpy as np
n = int(input())
mod = 10 ** 9 + 7
a = [list(bin(int(i))[2:].zfill(60)) for i in input().split()]
a = np.array(a)
x = a.T
x = x.tolist()
#print(x)
ans = 0
for i in range(60):
    y = x[i].count('0')
    z = x[i].count('1')
    tmp = ( (n * (n - 1) // 2) - (y * (y - 1) // 2) - (z * (z - 1) // 2) ) % mod
    tmp2 = 1
    for j in range(60 - i - 1):
        tmp2 = tmp2 * 2 % mod
    #print(tmp,tmp2)
    
    ans = (ans + tmp2 * tmp) % mod
print(ans)
    
    

### FIXED CODE ###

n = int(input())
x = list(map(int,input().split()))
mod = 10 ** 9 + 7
ans = 0
m = 1
for _ in range(60):
    bit = sum(a & m for a in x) #フラグが立ってる桁を合計
    bit //= m #1の個数を数えるためにmで割る
    non_bit = n - bit #0の個数を出す
    ans = (ans + bit * non_bit * m) % mod #桁の合計出す
    m <<= 1 #桁を1増やす
print(ans)
#??????????????? : ?¨??????\??????????????????????????????, http://qiita.com/clarinet758/items/53e31ec10b873975438b
a, b = map(int, raw_input().split())

s = a * b
l = 2 * (a + b)

print "%d, %d" % (s ,l)

### FIXED CODE ###

#reference : http://qiita.com/clarinet758/items/53e31ec10b873975438b
#reference : #1511943 Solution for ITP1_1_C: Rectangle by Signorte
# print "%d %d" % (s ,l) => ERROR

a, b = map(int, raw_input().split())

s = a * b
l = 2 * (a + b)

print "%s %s" % (str(s) ,str(l))
def main():
    """http://drken1215.hatenablog.com/entry/2019/03/03/224600
    """
    N, M=map(int, input().split())
    A, B =[],[]
    for i in  range(M):
        a,b=map(int, input().split())
        A.append(a-1)
        B.append(b-1)
        
    uf=UnionFind(N)
    cur = N * (N-1) // 2
    res =[]
    for a,b in zip(A[::-1],B[::-1]):
        res.append(cur)

        if uf.issame(a, b):
            continue
        
        sa = uf.size(a) * uf.size(b)
        cur -= sa * sb
        uf.merge(a, b)

    print(*res, sep="¥n")


class UnionFind:
    def __init__(self, n):
        self.par = [-1] * n
    # void init(int n) { par.assign(n, -1); }

    def root(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def merge(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y: return False
        if self.par[x] > self.par[y]:
            x, y = y, x # merge technique
        self.par[x] += self.par[y]
        self.par[y] = x
        return True
    
    def size(self, x):
        return -self.par[self.root(x)]

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    """http://drken1215.hatenablog.com/entry/2019/03/03/224600
    """
    N, M=map(int, input().split())
    A, B =[],[]
    for i in  range(M):
        a,b=map(int, input().split())
        A.append(a-1)
        B.append(b-1)
        
    uf=UnionFind(N)
    cur = N * (N-1) // 2
    res =[]
    for a,b in zip(A[::-1],B[::-1]):
        res.append(cur)

        if uf.issame(a, b):
            continue
        
        sa, sb = uf.size(a),  uf.size(b)
        cur -= sa * sb
        uf.merge(a, b)

    print(*res[::-1], sep="\n")


class UnionFind:
    def __init__(self, n):
        self.par = [-1] * n
    # void init(int n) { par.assign(n, -1); }

    def root(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def merge(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y: return False
        if self.par[x] > self.par[y]:
            x, y = y, x # merge technique
        self.par[x] += self.par[y]
        self.par[y] = x
        return True
    
    def size(self, x):
        return -self.par[self.root(x)]

if __name__ == "__main__":
    main()
maxnum = 10000

# エラトステネスのふるい
is_prime = [x for x in range(maxnum)]
for prime in is_prime:
    if prime == 0 or prime == 1:
        is_prime[prime] = 0
        continue
    for non_prime in range(prime * 2, maxnum, prime):
        is_prime[non_prime] = 0

is_like = [False] * maxnum
for i in range(maxnum):
    if (is_prime[i] and is_prime[(i + 1) // 2]):
        is_like[i] =  True

like_sum = [0] * maxnum
for i in range(3, maxnum):
    like_sum[i] = like_sum[i - 1]
    if (is_like[i]):
        like_sum[i] += 1

q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    print(like_sum[r] - like_sum[l])


### FIXED CODE ###

maxnum = 100000

# エラトステネスのふるい
is_prime = [x for x in range(maxnum)]
for prime in is_prime:
    if prime == 0 or prime == 1:
        is_prime[prime] = 0
        continue
    for non_prime in range(prime * 2, maxnum, prime):
        is_prime[non_prime] = 0

is_like = [False] * maxnum
for i in range(maxnum):
    if (is_prime[i] and is_prime[(i + 1) // 2]):
        is_like[i] =  True

like_sum = [0] * maxnum
for i in range(3, maxnum):
    like_sum[i] = like_sum[i - 1]
    if (is_like[i]):
        like_sum[i] += 1

q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    print(like_sum[r] - like_sum[l - 1])
s=str(input("enter a statment))
z=s.replace(","," ")
print(z)

### FIXED CODE ###

s=' '
s= input ()
b=s.replace("," ," ")
print (b)
list.sort (l, reverse=True)
a = int (l[0])
b = int (l[1])
c = int (l[2])
if a == b+c:
  print ('Yes')
else:
  print ('No')

### FIXED CODE ###

l = [int(x) for x in input().split()]
if l[2]==l[0]+l[1] or l[0]==l[1]+l[2] or l[1]==l[0]+l[2]:
  print ('Yes')
else:
  print ('No')
h,w = map(int,input().split())
c = [list(map(int,input().split())) for _ in range(10)]
a = [list(map(int,input().split())) for _ in range(h)]

def dfs(nv,vl,cost):
    if nv==1:
        return cost
    vl_ = vl.copy()
    vl_.append(nv)
    ret = []
    for i in range(10):
        if not i in vl_:
            ret.append(dfs(i,vl_,cost+c[nv][i]))
    return min(ret)
cost = []
for i in range(10):
    cost.append(dfs(i,[],0))
ans = 0
for i in range(h):
    for j in range(w):
        if a[i][j]!=-1:
            ans += cost[a[i][j]]
print(ans)

### FIXED CODE ###

h,w = map(int,input().split())
c = [list(map(int,input().split())) for _ in range(10)]
a = [list(map(int,input().split())) for _ in range(h)]
memo = {}
def dfs(nv,vl,cost):
    if nv==1:
        return cost
    if nv in memo.keys():
        return cost+memo[nv]
    vl_ = vl.copy()
    vl_.append(nv)
    ret = []
    for i in range(10):
        if not i in vl_:
            ret.append(dfs(i,vl_,cost+c[nv][i]))
    return min(ret)
cost = []
for i in range(10):
    memo[i] = dfs(i,[],0)
ans = 0
for i in range(h):
    for j in range(w):
        if a[i][j]!=-1:
            ans += memo[a[i][j]]
print(ans)
mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if nums[0] == 1:
	del nums[0]
else:
	dp[1] = 1
	

for i in range(2, n + 1):
	#print(i, dp, nums)
	if len(nums) ==  0:
		dp[i] = (dp[i - 1] + dp[i - 2]) % mod
	else:
		for j in range(len(nums)):
			if nums[j] > i:
				dp[i] = (dp[i - 1] + dp[i - 2]) % mod
				break
			elif nums[j] == i:
				del nums[:(j + 1)]
				break
#print(nums)
#print(dp)
print(dp[-1])


### FIXED CODE ###

mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if len(nums) > 0 and nums[0] == 1:
	del nums[0]
else:
	dp[1] = 1
	

for i in range(2, n + 1):
	#print(i, dp, nums)
	if len(nums) ==  0:
		dp[i] = (dp[i - 1] + dp[i - 2]) % mod
	else:
		for j in range(len(nums)):
			if nums[j] > i:
				dp[i] = (dp[i - 1] + dp[i - 2]) % mod
				break
			elif nums[j] == i:
				del nums[:(j + 1)]
				break
#print(nums)
#print(dp)
print(dp[-1])
input()
s = 0
a = input()
a = a.split(" ")
for u in a:
    s=s+int(a)

print(min(a),max(a),s)


### FIXED CODE ###

n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(int(n)):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)
s = str(input())
for i in range(len(s)):
  s[i] = 'x'
  
print(s)

### FIXED CODE ###

s = str(input())
for i in range(len(s)):
    s = s.replace(s[i], 'x')
  
print(s)
N=int(input())
a=input().split()
a2=sorted(a,reverse=True)
b1=a2[1::2]
b2=a2[0::2]
alice=sum(b1)
bob=sum(b2)
print(alice-bob)

### FIXED CODE ###

N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)
n = int(input())
s = input()

n_left = 0
ans = s
for i in range(n):
  if s[i] == '(':
    n_left += 1
  elif s[i] == ')':
	if n_left == 0:
      ans = '(' + ans
    else:
      n_left -= 1
for i in range(n_left):
  ans += ')'
print(ans)

### FIXED CODE ###

n = int(input())
s = input()

ans = s
n_left, n_right = 0, 0
for ss in s:
    if ss == '(':
        n_left += 1
    else:
        if n_left > 0:
            n_left -= 1
        else:
            ans = '('+ans
if n_left > 0:
    for _ in range(n_left): ans += ')'

print(ans)
import collections as cole


n = int(input())
v = list(map(int, input().split()))

v1 = v[::2]   #odd
v2 = v[1::2]  #even

d1 = cole.Counter(v1)
d2 = cole.Counter(v2)

values1, counts1 = zip(*d1.most_common())
values2, counts2 = zip(*d2.most_common())

max1 = values1[0]
max2 = values2[0]

if max1 == max2:
    if len(counts1) != 1 and counts1[0] == counts1[1]:
        max1 = values[1]
    elif len(counts2) != 1 and counts2[0] == counts[1]:
        max2 = values[1]
    elif len(counts1) != 1 and len(counts2) != 1:
        if counts1[1] > counts2[1]:
            max1 = values1[1]
        else:
            max2 = values2[1]
    elif len(counts1) != 1:
        max1 = values1[1]
    elif len(counts2) != 1:
        max2 = values2[1]

print(max1, max2)
count = 0
if max1 != max2:
    count += len([x for x in v1 if x != max1])
    count += len([y for y in v2 if y != max2])

else:
    count += len(v1)


print(count)


### FIXED CODE ###

import collections as cole


n = int(input())
v = list(map(int, input().split()))

v1 = v[::2]   #odd
v2 = v[1::2]  #even

d1 = cole.Counter(v1)
d2 = cole.Counter(v2)

values1, counts1 = zip(*d1.most_common())
values2, counts2 = zip(*d2.most_common())

max1 = values1[0]
max2 = values2[0]

if max1 == max2:
    if len(counts1) != 1 and counts1[0] == counts1[1]:
        max1 = values1[1]
    elif len(counts2) != 1 and counts2[0] == counts2[1]:
        max2 = values2[1]
    elif len(counts1) != 1 and len(counts2) != 1:
        if counts1[1] > counts2[1]:
            max1 = values1[1]
        else:
            max2 = values2[1]
    elif len(counts1) != 1:
        max1 = values1[1]
    elif len(counts2) != 1:
        max2 = values2[1]


count = 0
if max1 != max2:
    count += len([x for x in v1 if x != max1])
    count += len([y for y in v2 if y != max2])

else:
    count += len(v1)


print(count)
N,M = map(int, input().split())
A = [int(a) for a in input().split()]

A.sort(reverse=True)
List = [[] for i in range(100)]
for i in range(M):
    temp = bin(A[i])
    List[len(temp)-3].append(A[i])

List.reverse()
List = [i for i in List if i != []]
for i in range(len(List)):
    List[i].sort(reverse=True)
c = 0
cnt = 0
while cnt < M:
    for i in range(cnt+1):
        for j in range(len(List[i])):
            List[i][j] = List[i][j]//2
            c += 1
            if c == M:
                c = M+1
                break
        if c > M:
            break
    cnt += 1
            
ans = 0
for i in range(len(List)):
    ans += sum(List[i])
            
print(ans)

### FIXED CODE ###

N,M = map(int, input().split())
A = [int(a) for a in input().split()]

import heapq

h = []
for i in range(N):
    heapq.heappush(h, A[i]*(-1))
    
for i in range(M):
    temp = heapq.heappop(h)
    temp *= (-1)
    temp //= 2
    temp *= (-1)
    heapq.heappush(h, temp)
    
print(sum(h)*(-1))
while True:
    a,b,c = map(int,input().strip().split())
    if(a>b+c):
        print(0)
    else:
        print(b + c - a)

### FIXED CODE ###

while True:
    try:
        a,b,c = map(int,input().strip().split())
        print(max(b + c - a,0))
    except:
        break
import math
 
A, B = map(int, input().split())

print((A * B) // math.gcd(A, B))

### FIXED CODE ###

import fractions
A, B = map(int, input().split())

print((A * B) // fractions.gcd(A, B))
from collections import deque
n,m = map(int,input().split())

net = [[] for _ in range(n+1)]
for _ in range(m):
    a,b = map(int,input().split())

    net[a].append(b)
    net[b].append(a)

a = [-1] * (n+1)
d = deque()
d.append(1)
while d:
    u = d.popleft()
    for child in net[u]:
        if a[child] != -1:continue
        a[child] = u
        d.append(child)
print("Yes")
print(*a[2:], seq = " ")


### FIXED CODE ###

from collections import deque
n,m = map(int,input().split())

path = []
net = [[] for _ in range(n+1)]
for _ in range(m):
    a,b = map(int,input().split())

    net[a].append(b)
    net[b].append(a)

a = [-1] * (n+1)
d = deque()
d.append(1)
while d:
    u = d.popleft()
    for child in net[u]:
        if a[child] != -1:continue
        a[child] = u
        d.append(child)
a = a[2:]
for z in a:
    if z == -1:
        print("No")
        exit()
print("Yes")
for z in a:
    print(z)
import heapq
def main():
    H, W, M = map(int, input().split())

    bn_h = {}
    bn_v = {}

    for i in range(M):
        h, w = map(int, input().split())
        bn_h.setdefault(h, set())
        bn_h[h].add(w)
        bn_v.setdefault(w, set())
        bn_v[w].add(h)

    b1 = sorted(bn_h.items(), key = lambda x:len(x[1]), reverse=True)
    b2 = sorted(bn_v.items(), key = lambda x:len(x[1]), reverse=True)

    m1 = len(b1[0][1])
    m2 = len(b2[0][1])

    max_result = 0
    for i in b1:
        h, sh = i
        if len(sh) < m1:
            break
        for j in b2:
            v, sv = j
            if len(sv) < m2:
                break
            result = len(sh) + len(sv) - 1
            if h not in sv:
                result += 1
                flag = True
            max_result = max(max_result, result)
            if flag == True:
                break
        if flag == True:
            break
    print(max_result)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import heapq
def main():
    H, W, M = map(int, input().split())

    bn_h = {}
    bn_v = {}

    for i in range(M):
        h, w = map(int, input().split())
        bn_h.setdefault(h, set())
        bn_h[h].add(w)
        bn_v.setdefault(w, set())
        bn_v[w].add(h)

    b1 = sorted(bn_h.items(), key = lambda x:len(x[1]), reverse=True)
    b2 = sorted(bn_v.items(), key = lambda x:len(x[1]), reverse=True)

    m1 = len(b1[0][1])
    m2 = len(b2[0][1])

    flag = False
    max_result = 0
    for i in b1:
        h, sh = i
        if len(sh) < m1:
            break
        for j in b2:
            v, sv = j
            if len(sv) < m2:
                break
            result = len(sh) + len(sv) - 1
            if h not in sv:
                result += 1
                flag = True
            max_result = max(max_result, result)
            if flag == True:
                break
        if flag == True:
            break
    print(max_result)

if __name__ == '__main__':
    main()
a,b,c,d=map(int,input().split())
if b<=c or d<=a:
    print(0)
else:
    print(min(d,b)-max(a,c))

### FIXED CODE ###

n=input()
if len(n)%2==0:
    m=int(len(n)/2)
else:
    m=int((len(n)-1)/2)

a=0

for i in range(m):
    if n[i]==n[-1*(i+1)]:
       continue
    else:
        a+=1

if a==0:
    print('Yes')
else:
    print('No')
MOD = 1000000007

def main():
    n,m = map(int,input().split())
    al = [False for _ in range(n+1)]
    for i in range(m):
        a = int(input())
        al[a] = True
    
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0

    for i in range(2,n+1):
        if not al[i]:
            dp[i] = (dp[i-2] + dp[i-1]) % MOD

    print(dp[n])


if __name__ == "__main__":
    main()

### FIXED CODE ###

from fractions import gcd

def main():
    n = int(input())
    a = list(map(int,input().split()))

    lgcd = [0 for _ in range(n)]
    rgcd = [0 for _ in range(n)]
    for i in range(n):
        if i == 0:
            lgcd[i] = a[i]
            rgcd[-i-1] = a[-i-1]
        else:
            lgcd[i] = gcd(lgcd[i-1],a[i])
            rgcd[-i-1] = gcd(rgcd[-i],a[-i-1]) 
    
    ans = 0
    for i in range(n):
        if i == 0:
            ans = max(ans,rgcd[i+1])
        elif i == n-1:
            ans = max(ans,lgcd[i-1])
        else:
            ans = max(ans,gcd(lgcd[i-1],rgcd[i+1]))

    print(ans)

if __name__ == "__main__":
    main()
def main():
    h, w, m = map(int, input().split())
    L = [list(map(int,input().split())) for _ in range(m)]
    table = [[0] * w for _ in range(h)]
    for a, b in L:
        table[a-1][b-1] = -1
    col = [0] * w
    row = [0] * h
    for i in range(w):
        col[i] = -sum([T[i] for T in table])
    for j in range(h):
        row[j] = -sum(table[j])
    for i in range(h):
      for j in range(w):
        table[i][j] += col[j] + row[i]
    print(max(max(T) for T in table))
main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    h, w, m = map(int, input().split())
    bomb_row = [0] * h
    bomb_col = [0] * w
    # 座標だけはsetで格納
    bomb_pos = set()
    # 爆弾情報を行と列ごとで格納
    for _ in range(m):
        r, c = [int(i) - 1 for i in input().split()]
        bomb_row[r] += 1
        bomb_col[c] += 1
        bomb_pos.add((r,c))

    bomb_row_max = max(bomb_row)
    bomb_col_max = max(bomb_col)

    row_index = [i for i, v in enumerate(bomb_row) if v == bomb_row_max]
    col_index = [i for i, v in enumerate(bomb_col) if v == bomb_col_max]
    ans = bomb_col_max + bomb_row_max
    for row in row_index:
        for col in col_index:
            if (row, col) not in bomb_pos:
                print(ans)
                return
    print(ans-1)
main()
n,k=map(int,input().split())

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

    
    


for i in range(1,k+1):
    a = comb(k-1, i-1, exact=True)
    b = comb(n-k+1, i, exact=True)
    print((a*b)%(10**9+7))




### FIXED CODE ###

import math

n,k=map(int,input().split())

def comb(n, r):
    if n-r>=0:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else: 
        return 0

for i in range(1,k+1):
    a = comb(k-1, i-1)
    b = comb(n-k+1, i)
    print((a*b)%(10**9+7))
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
  	if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")


### FIXED CODE ###

S = list(input())
for i in range(len(S)):
	if i % 2 == 0:
		if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
	else:
		if (S[i] == "L") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
print("Yes")
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IS(): return str(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve(N,A):
    ans = 1
    if 0 in A:
        print(0)
        return
    
    for i in A:
        ans *= i
        if ans > pow(10,18)
            print(-1)
            return
    print(ans)

def main():
    N = II()
    A = LI()
    solve(N,A)

#main
if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IS(): return str(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve(N,A):
    ans = 1
    if 0 in A:
        print(0)
        return
    
    for i in A:
        ans *= i
        if ans > pow(10,18):
            print(-1)
            return
    print(ans)

def main():
    N = II()
    A = LI()
    solve(N,A)

#main
if __name__ == '__main__':
    main()
#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7

s=int(input())
n=len(s)+1
ans=[0]*n
for i in range(n-1):
    if s[i]=='<':
        ans[i+1]=max(ans[i+1],ans[i]+1)
for i in range(n-2,-1,-1):
    if s[i]=='>':
        ans[i]=max(ans[i+1]-1),ans[i]
print(sum(ans))

### FIXED CODE ###

#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7

S=input()
S=">"+S
n=len(S)
data=[0]*n
start=0
minv=0
for i in range(1,n):
    if S[i]=='<':
        data[i]=data[i-1]+1
    if S[i]=='>':
        if S[i-1]=='<':
            # print(minv)
            for k in range(start+1,i):
                data[k]-=minv
            data[start]=max(data[start],data[start+1]+1)
            # print(data,i,minv)
            data[i]=0
            minv=0
            start=i-1
        else:
            data[i]=data[i-1]-1
            minv=min(minv,data[i])
# print(data)
# print(minv,start)
for i in range(start+1,n):
    data[i]-=minv
data[start]=max(data[start],data[start+1]+1)
if S[1]=='<':
    data[0]=0
print(sum(data))
# print(data)
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
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 II(): return int(sys.stdin.readline())
def SI(): return int(input())
from collections import defaultdict, Counter
import bisect

sys.setrecursionlimit(10000000)

n = SI()
xy = [(0,0) for _ in range(n)]
div = []
for i in range(n):
    x, y = LI()
    xy[i] = (x, y)
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            div.append("{}_{}".format(xy[i][0] - xy[j][0], xy[i][1]- xy[j][1]))
c = Counter(div)
max_ = c.most_common()[0][1]
print(n - max_)

### FIXED CODE ###

import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
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 II(): return int(sys.stdin.readline())
def SI(): return int(input())
from collections import defaultdict, Counter
import bisect

sys.setrecursionlimit(10000000)

n = SI()
xy = [(0,0) for _ in range(n)]
div = defaultdict(int)
for i in range(n):
    x, y = LI()
    xy[i] = (x, y)
if n==1:
    print(1)
else:
    for i in range(n):
        for j in range(n):
            if i == j:
                continue
            else:
                div["{}_{}".format(xy[i][0] - xy[j][0], xy[i][1]- xy[j][1])] += 1

    max_ = max(div.values())
    print(n - max_)