Harryxun/stf_run huggingface dataset:
N = int(input())
B = [10 ** 9 + 1]
for i in range(N):
  A = int(input())
  flag = True
  for j in range(len(B)):
    if A > B[j]:
      B[j] = A
      flag = False
      break
  if flag:
    B.append(A)
print(len(B) - 1)


### FIXED CODE ###

r = int(input())
print(3 * r ** 2)
from scipy.special import comb
N,P=map(int,input().split())
A=list(map(lambda x:int(x)%2,input().split()))
A0,A1=A.count(0),A.count(1)
if P==1:
    if not A1:
        print(0)
        exit()
value0=0
for i in range(0,A0+1):
    value0+=comb(A0, i, exact=True)
value1=0
for i in range(2-P,A1+1,2):
    value1+=comb(A1, i, exact=True)
print(value0*value1+(1 if not P else 0))


### FIXED CODE ###

from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N,P=map(int,input().split())
A=list(map(lambda x:int(x)%2,input().split()))
A0,A1=A.count(0),A.count(1)
if P==1:
    if not A1:
        print(0)
        exit()
value0=0
for i in range(0,A0+1):
    value0+=comb(A0, i)
value1=(1 if not P else 0)
for i in range(2-P,A1+1,2):
    value1+=comb(A1, i)
print(value0*value1)
A, B, K = map(int, input().split())

if A <= K:
    print(0, max(B - (K - A), 0)
else:
    print(A - K, B)


### FIXED CODE ###

A, B, K = map(int, input().split())

if A <= K:
    print(0, max(B - (K - A), 0))
else:
    print(A - K, B)
print("no"if len(set(input()))!=len(input()) else"yes")

### FIXED CODE ###

a=input()
print("no"if len(set(a))!=len(a)else"yes")
n = int(input())
lst = list(map(int, input().split()))

accum_xor = []
s = 0
for i in lst:
    s = s ^ i
    accum_xor.append(s)

accum_lst = list(itertools.accumulate(lst))

def bisearch(start, n, accum_xor, accum_lst):
    low = start
    high = n
    while True:
        i = (low+high)//2
        if start == 0:
            if accum_xor[i] == accum_lst[i]:
                low = i
            else:
                high = i
        else:
            if accum_xor[start-1] ^ accum_xor[i] == accum_lst[i] - accum_lst[start-1]:
                low = i
            else:
                high = i
        if high - low <= 1:
            if start == 0:
                if accum_xor[high] == accum_lst[high]:
                    flg = True
                else:
                    flg = False
            else:
                if accum_xor[start-1] ^ accum_xor[high] == accum_lst[high] - accum_lst[start-1]:
                    flg = True
                else:
                    flg = False
            break
    return high if flg else low

s = 0
for i in range(n):
    a = bisearch(i, n-1, accum_xor, accum_lst) - i + 1
    s += a
print(s)

### FIXED CODE ###

import itertools

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

accum_xor = []
s = 0
for i in lst:
    s = s ^ i
    accum_xor.append(s)

accum_lst = list(itertools.accumulate(lst))

def bisearch(start, n, accum_xor, accum_lst):
    low = start
    high = n
    while True:
        i = (low+high)//2
        if start == 0:
            if accum_xor[i] == accum_lst[i]:
                low = i
            else:
                high = i
        else:
            if accum_xor[start-1] ^ accum_xor[i] == accum_lst[i] - accum_lst[start-1]:
                low = i
            else:
                high = i
        if high - low <= 1:
            if start == 0:
                if accum_xor[high] == accum_lst[high]:
                    flg = True
                else:
                    flg = False
            else:
                if accum_xor[start-1] ^ accum_xor[high] == accum_lst[high] - accum_lst[start-1]:
                    flg = True
                else:
                    flg = False
            break
    return high if flg else low

s = 0
for i in range(n):
    a = bisearch(i, n-1, accum_xor, accum_lst) - i + 1
    s += a
print(s)
import sys
s=1e10,b=-s
input()
for r in map(int,sys.stdin):
 if b<r-s:b=r-s
 if s>r:s=r
print(b)


### FIXED CODE ###

import sys
def f():
 s=1e10;b=-s
 input()
 for r in map(int,sys.stdin):
  if b<r-s:b=r-s
  if s>r:s=r
 print(b)
f()
# coding: utf-8
a, b, c = map(int, input.split())

if a = b and b = c and c = a:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

# coding: utf-8
a, b, c = map(int, input().split())

if a == b and b == c and c == a:
    print('Yes')
else:
    print('No')
a,b=int(input().split())
ans=1
bb=b-a
while bb>0:
  bb=bb-(a-1)
  ans+=1
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
if b==1:
	print(0)
else:
	ans=1
	bb=b-a
	while bb>0:
  		bb=bb-(a-1)
  		ans+=1
	print(ans)
s=input()
ss=int(s)
keep=0
for i in range(len(s)):
  keep+=int(i)
if ss%keep==0:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

s=input()
ss=int(s)
keep=0
for i in range(len(s)):
  keep+=int(s[i])
if ss%keep==0:
  print("Yes")
else:
  print("No")
input()
if N[-1] in '24579'
    print('hon')
elif N[-1] in '0168':
    print('pon')
else:
    print('bon')

### FIXED CODE ###

n = input()
if n[-1] in '24579':
    print('hon')
elif n[-1] in '0168':
    print('pon')
else:
    print('bon')
from Collections import Counter
s=input()
c=Counter(s)
if(len(c.keys())==1):
  print ("No")
else:
  print ("Yes")

### FIXED CODE ###

from collections import Counter
s=input()
c=Counter(s)
if(len(c.keys())==1):
    print ("No")
else:
    print ("Yes")
input()
 N = N % 10
if N == 2 or N == 4 or N == 5 or N == 7 or N == 9:
     print('hon')
elif N == 3:
    print('bon')
else:
    print('pon')

### FIXED CODE ###

N = int(input())
N = N % 10
if N == 2 or N == 4 or N == 5 or N == 7 or N == 9:
     print('hon')
elif N == 3:
    print('bon')
else:
    print('pon')
#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-

# abc126_d

from collections import namedtuple

DistFrom = namedtuple('DistFrom', ['f', 'dist'])

def main():
    # Input
    n, = [int(s) for s in input().split()]
    #if n==1: return
    fs = [[int(s) for s in input().split()] for _ in range(n-1)]
    # Get ans
    gs = [None] * n
    for i in range(n):
        gs[i] = list()
    for x, y, d in fs:
        x -= 1
        y -= 1
        d = d%2
        gs[x].append(DistFrom(y, d))
        gs[y].append(DistFrom(x, d))
    distlist = [None] * n
    def dfs(cur, dist):
        if distlist[cur] != None:
            return
        distlist[cur] = dist
        for i, d in gs[cur]:
            dfs(i, dist^d)
    dfs(0, 0)
    ans = distlist
    # Output
    for a in ans:
        print(a)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
 
sys.setrecursionlimit(10**5)

n = int(input())
p = [list() for _ in range(n)]
for i in range(n-1):
    u, v, w = [int(s) for s in input().split()]
    u -= 1
    v -= 1
    w %= 2
    p[u].append((v, w))
    p[v].append((u, w))

costs = [-1 for _ in range(n)]

def dfs(cur, dist):
    if costs[cur] != -1:
        return
    costs[cur] = dist
    for v, d in p[cur]:
        dfs(v, dist^d)
dfs(0, 0)

for i in range(n):
    print(costs[i])
N = int(input())
A = list(map(int, input().split()))

result = [0] * N
for a in A:
    result[a - 1] += 1
print('\n'.join(result))


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

for i in range(1, N + 1):
    if i in d:
        print(len(d[i]))
    else:
        print(0)
print(sum([max([int(n) for n in input().strip().split()])-a for a in [0,1]]))

### FIXED CODE ###

nm = [int(n) for n in input().split()];nm.extend([n-1 for n in nm]);nm.sort();nm.reverse();print(sum(nm[:2]));
n, m = map(int, input().split())
edges = [[]for _ in range(n)]
for _ in range(m):
    x, y = map(lambda x: int(x)-1, input().split())
    edges[x].append(y)



def dfs(v, parent):
    visited[v] = 1
    for v2 in edges[v]:
        if v2 == parent:
            continue
        dfs(v2, v)
        dist[v] = max(dist[v], dist[v2]+1)


dist = [0]*n
visited = [0]*n

for i in range(n):
    if visited[i]:
        continue
    dfs(i, -1)

print(max(dist))


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(m):
    x, y = list(map(lambda x: int(x)-1, input().split()))
    edges[x].append(y)


def memoize(f):
    memo = dict()

    def memoized(*args):
        if args in memo.keys():
            return memo[args]
        else:
            memo[args] = f(*args)
            return memo[args]
    return memoized

@memoize
def longest_path(v):
    retval = 0
    for v2 in edges[v]:
        retval = max(retval, longest_path(v2)+1)
    return retval


ans = 0
for i in range(n):
    ans = max(ans, longest_path(i))
print(ans)
import math
tile=int(input())
if len(str(tile))==1:
    print(0)
    exit()
if len(str(tile))%2==1:
    tile1=int("01"*int(math.ceil(len(str(tile))/2)),2)
    tile2=int("10"*int(math.ceil(len(str(tile))/2)),2)
else:
    tile1=int("01"*int(len(str(tile))/2),2)
    tile2=int("10"*int(len(str(tile))/2),2)

tile_10=int(str(tile),2)
convert1=format(tile_10^tile1,'b').zfill(len(str(tile)))
convert2=format(tile_10^tile2,'b').zfill(len(str(tile)))
if convert1.count("1")<=convert2.count("1"):
    print(convert1.count("1"))
else:
    print(convert2.count("1"))


### FIXED CODE ###

a,b=map(int,input().split())
answer=0
for x in range(2):
    if a>=b:
        answer+=a
        a-=1
    else:
        answer+=b
        b-=1
print(answer)
import numpy as np
N,M = map(int,input().split())
AB = np.array([[0]*M]*M)

for i in range(M):
  a,b = map(int,input().split())
  AB[a-1][i] = b
for i in range(M):
  if AB[0][i] != 0:
    k = AB[0][i]-1
    for j in range(M):
      if AB[k][j] == N:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


### FIXED CODE ###

N,M = map(int,input().split())
tmp = [0]*N

for _ in range(M):
  a,b = map(int,input().split())
  if a == 1:
    if tmp[b-1] == 1:
      print('POSSIBLE')
      exit()
    else:
      tmp[b-1] = 1
  elif b == N:
    if tmp[a-1] == 1:
      print('POSSIBLE')
      exit()
    else:
      tmp[a-1] = 1
print("IMPOSSIBLE")
n=int(input())
now=[1,2,3,4,5,6,7,8,9]
if n<10:
  print(now[n-1])
  exit()
cnt=9
while True:
  next=[]
  for s in now:
    s=str(s)
    if s[-1]!="0":
      cnt+=1
      if cnt<n:
        next.append(s+str(int(s[-1]-1)))
      else:
        print(s+str(int(s[-1]-1)))
        exit()
    cnt+=1
    if cnt<n:
      next.append(s+s[-1])
    else:
      print(s+s[-1])
      exit()
    if s[-1]!="9":
      cnt+=1
      if cnt<n:
        next.append(s+str(int(s[-1]+1)))
      else:
        print(s+str(int(s[-1]+1)))
        exit()
  now=next


### FIXED CODE ###

n=int(input())
now=[1,2,3,4,5,6,7,8,9]
if n<10:
  print(now[n-1])
  exit()
cnt=9
while True:
  next=[]
  for s in now:
    s=str(s)
    if s[-1]!="0":
      cnt+=1
      if cnt<n:
        next.append(s+str(int(s[-1])-1))
      else:
        print(s+str(int(s[-1])-1))
        exit()
    cnt+=1
    if cnt<n:
      next.append(s+s[-1])
    else:
      print(s+s[-1])
      exit()
    if s[-1]!="9":
      cnt+=1
      if cnt<n:
        next.append(s+str(int(s[-1])+1))
      else:
        print(s+str(int(s[-1])+1))
        exit()
  now=next
import numpy as np

N = input().split()

Nsum = list()
op = list()
for i in range(len(N)-1):
    if N[i].isdigit():
        op.append(float(N[i]))
    else:
        if N[i] == "+":
            Nsum.append(op[0] + op[1])
            op = list()
        elif N[i] == "-":
            Nsum.append(op[0] - op[1])
            op = list()
        elif N[i] == "*":
            Nsum.append(op[0] * op[1])
            op = list()


if N[-1] == "+":
    print(np.sum(Nsum))
elif N[-1] == "-":
    Nsub = Nsum[0]
    for n in Nsum[1:]:
        Nsub -= n
    print(Nsub)

elif N[-1] == "*":
    print(np.prod(Nsum))

### FIXED CODE ###


o = list()
top = -1
for s in input().split():
    if s.isdigit():
        o.append(int(s))
        top += 1
    else:
        if s is "+":
            n = o[top]+o[top-1]
            o.pop(top)
            top-=1
            o.pop(top)
            top-=1
            o.append(n)
            top+=1
        if s is "-":
            n = o[top-1] - o[top]
            o.pop(top)
            top -= 1
            o.pop(top)
            top -= 1
            o.append(n)
            top+=1
        if s is "*":
            n = o[top]*o[top-1]
            o.pop(top)
            top -= 1
            o.pop(top)
            top -= 1
            o.append(n)
            top+=1


print(o[0])
N, num_of_blue, num_of_red = map(int, input().split())

num_of_repetition = (N // (num_of_blue + num_of_red))
remainder_s = N % (num_of_blue + num_of_red)
base_s ='b' * num_of_blue + 'r' * num_of_red
count_b = num_of_blue * num_of_repetition + base_s[0:remainder_s].count('b')

print(count_b)

### FIXED CODE ###

N, num_of_blue, num_of_red = map(int, input().split())

num_of_repetition = (N // (num_of_blue + num_of_red))
remainder_s = N % (num_of_blue + num_of_red)

count_b = num_of_blue * num_of_repetition + min(num_of_blue, remainder_s)

print(count_b)
import math

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

myans = (A * B) // math.gcd(A, B)

print(myans)

### FIXED CODE ###

import fractions

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

myans = (A * B) // fractions.gcd(A, B)


print(myans)
res=[]

while True:
    s=input()
    if s:
        a,b = [int(x) for x in s.split()]
        res.append(a+b)
    else:
        break

for n in res:
    print(len(str(n)))

### FIXED CODE ###

res=[]

while 1:
    try:
        s=input()
        a,b = [int(x) for x in s.split()]
        res.append(a+b)
    except:
        for n in res:
            print(len(str(n)))
        break
n=input()
N=n//10

if n=2　or 4 or 5 or 7 or 9:
  print(hon)
elif n=0 or 1 or 6 or 8:
  print(pon)
else:
  print(bon)


### FIXED CODE ###

N=input()
n=int(N)%10

if n==2:
  print('hon')
elif n==4:
  print('hon')
elif n==5:
  print('hon')
elif n==7:
  print('hon')
elif n==9:
  print('hon')
elif n==0:
  print('pon')
elif n==1:
  print('pon')
elif n==6:
  print('pon')
elif n==8:
  print('pon')
elif n==3:
  print('bon')
A1_1,A1_2,A1_3 = map(int, input().split())
A2_1,A2_2,A2_3 = map(int, input().split())
A3_1,A3_2,A3_3 = map(int, input().split())
N = map(int, input().split())
B = []
for _ in range(N):
    B.append(input())

a=str('yes')
b=str('no')
if A1_1 in B and A1_2 in B and A1_3 in B:
     print(a)
elif A2_1 in B and A2_2 in B and A2_3 in B:
    print(a)
elif A3_1 in B and A3_2 in B and A3_3 in B:
     print(a)
elif A1_1 in B and A2_1 in B and A3_1 in B:
    print(a)
elif A1_2 in B and A2_2 in B and A3_2 in B:
    print(a)
elif A1_3 in B and A2_3 in B and A3_3 in B:
    print(a)
elif A1_1 in B and A2_2 in B and A3_3 in B:
     print(a)
elif A1_3 in B and A2_2 in B and A3_1 in B:
    print(a)
else:
    print(b)

### FIXED CODE ###

A1_1,A1_2,A1_3 = map(int, input().split())
A2_1,A2_2,A2_3 = map(int, input().split())
A3_1,A3_2,A3_3 = map(int, input().split())
N =int(input())
B = []
for _ in range(N):
    B.append(int(input()))

a=str('Yes')
b=str('No')
if A1_1 in B and A1_2 in B and A1_3 in B:
     print(a)
elif A2_1 in B and A2_2 in B and A2_3 in B:
    print(a)
elif A3_1 in B and A3_2 in B and A3_3 in B:
     print(a)
elif A1_1 in B and A2_1 in B and A3_1 in B:
    print(a)
elif A1_2 in B and A2_2 in B and A3_2 in B:
    print(a)
elif A1_3 in B and A2_3 in B and A3_3 in B:
    print(a)
elif A1_1 in B and A2_2 in B and A3_3 in B:
     print(a)
elif A1_3 in B and A2_2 in B and A3_1 in B:
    print(a)
else:
    print(b)
N = int(input())
h = list(map(int, input().split())) + [0, 0, 0]

dp = [float("inf")]*10010
dp[0] = 0

for i in range(N):
    dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1] - h[i]))
    dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2] - h[i]))
    # print(dp)
print(dp[N-1])

### FIXED CODE ###

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

dp = [0]*n
for i in range(n):
    if i >= 2:
        dp[i] = min(dp[i-1]+abs(a[i]-a[i-1]), dp[i-2]+abs(a[i]-a[i-2]))
    elif i == 1:
        dp[i] = abs(a[i]-a[i-1])
print(dp[-1])
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  3 19:52:57 2019

@author: Yamazaki Kenichi
"""
from scipy.special import comb

N,M = map(int,input().split())
bb = [list(map(int,(input().split()))) for i in range(M)]

ans = [int(comb(N,2))]
A = [-1 for i in range(N+1)]
B = [[] for i in range(N+1)]
k = 0
bb.reverse()
for c in bb:
    if ans[-1] == 0:
        ans.append(0)
        continue
    if A[c[0]] == -1 and A[c[1]] ==-1:
        A[c[0]] = k
        A[c[1]] = k
        ans.append(ans[-1]-1)
        B[k].extend(c)
        k += 1
    elif A[c[0]] != -1 and A[c[1]] ==-1:
        tmp = A[c[0]]
        A[c[1]] = tmp
        ans.append(ans[-1]-len(B[tmp]))
        B[tmp].append(c[1])
    elif A[c[0]] == -1 and A[c[1]] !=-1:
        tmp = A[c[1]]
        A[c[0]] = tmp
        ans.append(ans[-1]-len(B[tmp]))
        B[tmp].append(c[0])
    else:
        tmp1 = A[c[0]]
        tmp2 = A[c[1]]
        ans.append(ans[-1]-len(B[tmp1])*len(B[tmp2]))
        tmp = B[tmp1][:]
        B[tmp1] += B[tmp2]
        B[tmp2] += B[tmp1]
for i in range(M):
    print(ans[-i-2])

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Wed Mar  6 14:59:59 2019

@author: Yamazaki Kenichi
"""

N,M = map(int,input().split())
bb = [list(map(int,(input().split()))) for i in range(M)]

def comb2(N):
    return N*(N-1)//2
ans = [int(comb2(N))]
bb.reverse()

T = [[-1,1] for i in range(N+1)]
def p(u):
    return T[u][0]
def findset(u):
    if p(u) == -1:
        return u
    else:
        T[u][0] = findset(p(u))
        return T[u][0]
def unite(u,v):
    if findset(u) == findset(v):
        return    
    if T[findset(u)][1] >= T[findset(v)][1]:
        T[findset(u)][1] += T[findset(v)][1]
        T[findset(v)][0] = findset(u)
    else:
        T[findset(v)][1] += T[findset(u)][1]
        T[findset(u)][0] = findset(v)
        
for c in bb:
    if findset(c[0]) != findset(c[1]):
        res1 = T[findset(c[0])][1]
        res2 = T[findset(c[1])][1]
        unite(c[0],c[1])
        ans.append(ans[-1]-res1*res2)
    else:
        ans.append(ans[-1])
for i in range(M):
    print(ans[-i-2])
#!/usr/bin/env python3
# -*- Coding: utf-8 -*-

import sys


def main():
    S = input()
    K = int(input())
    ary = []
    ans = 0
    n = 1

    for i, s in enumerate(S[1:]):
        if s == S[i]:
            n += 1
        else:
            ary.append(n)
            n = 1
    if n != 1:
        ary.append(n)

    if S[0] == S[-1]:
        for num in ary[1:-1]:
            ans += num//2
        ans *= K
        if len(ary) == 1:
            ans += ary[0]*K//2
        else:
            ans += (ary[0]+ary[-1])//2*(K-1)
            ans += ary[0]//2+ary[-1]//2
    else:
        for num in ary:
            ans += num//2
        ans *= K
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
# -*- Coding: utf-8 -*-

import sys


def main():
    S = input()
    K = int(input())
    ary = []
    ans = 0
    n = 1

    for i, s in enumerate(S[1:]):
        if s == S[i]:
            n += 1
        else:
            ary.append(n)
            n = 1
    if n != 1:
        ary.append(n)

    if S[0] == S[-1]:
        for num in ary[1:-1]:
            ans += num//2
        ans *= K
        if len(ary) == 1:
            ans += ary[0]*K//2
        elif len(ary) < 1:
            ans = K//2
        else:
            ans += (ary[0]+ary[-1])//2*(K-1)
            ans += ary[0]//2+ary[-1]//2
    else:
        for num in ary:
            ans += num//2
        ans *= K
    print(ans)


if __name__ == '__main__':
    main()
from math import gcd
N, M = map(int, input().split())
S = input()
T = input()

L = N // gcd(N, M) * M
memo = [0] * (L + 10)


ok = True

ds = L // N
for i in range(N):
    memo[i * ds] = S[i]
dt = L // M
for i in range(M):
    if not memo[i * dt]:
        continue
    if memo[i * dt] != T[i]:
        ok = False

if ok:
    print(L)
else:
    print(-1)

### FIXED CODE ###

n, m = map(int, input().split())
s = input()
t = input()


def euclid(x, y):
    x, y = max(x, y), min(x, y)
    if y == 0:
        return x
    return euclid(y, x % y)


lcm = n * m // euclid(n, m)
nn = lcm // n
mm = lcm // m
ss = s[0::mm]
tt = t[0::nn]

if ss == tt:
    print(lcm)
else:
    print(-1)
n , m = map(int,input().split())
d = {}

g = [i for i in range(n+1)]
def find(x):
    if g[x] == x:
        return x
    g[x] = find(g[x])
    return g[x]
def union(x,y):
    x = find(x)
    y = find(y)
    if x!=y:
        g[x] = y

for i in range(m):
    xi,yi,zi = map(int,input().split())
    union(xi,yi)

print(len(set([find(i) for i in range(1,n+1)])))


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
n , m = map(int,input().split())
g = [i for i in range(n)]
def find(x):
    if g[x] == x:
        return x
    g[x] = find(g[x])
    return g[x]
def union(x,y):
    x = find(x)
    y = find(y)
    if x!=y:
        g[x] = y

for i in range(m):
    xi,yi,zi = map(int,input().split())
    union(xi-1,yi-1)

ans = 0
for i in range(n):
    if find(i) == i:
        ans += 1
print(ans)
print((int(input())+(int(input()))*int(input())//2)

### FIXED CODE ###

print((int(input())+int(input()))*int(input())//2)
import math
N = int(input())
res = []
num = []
for i in range(1, int(math.sqrt(N+1))):
  if N % i == 0:
    div = N // i
    if div >= i:
      str_num = str(div)
      res.append(len(list(str_num)))
print(min(res))

### FIXED CODE ###

import math
N = int(input())
res = []
num = []
for i in range(1, int(math.sqrt(N+1))+1):
  if N % i == 0:
    div = N // i
    if div >= i:
      str_num = str(div)
      res.append(len(list(str_num)))
print(min(res))
S = list(map(str,input()))
# s = "><<<<><<"
# S = list(map(str,s))
num = [-1]*(len(S)+1)
index0 = list()
than = 0# 0 == >, 1 == <
#----------------------------------------
for i in range(len(S)):
    if(S[i] == '<'):
        if(than == 0):
            num[i] = 0
            index0.append(i)
        than = 1
    else:
        than = 0
if(S[-1] == '>'):
    num[-1] = 0
    index0.append(len(S)+1)
#--------------------------------------
if(index0[0] == 0):
    i = 1
    while(True):
        num[i] = num[i-1]+1
        if(S[i] == '>'):
            break
        i+=1
    index0.pop(0)
if(index0[-1] == len(S)+1):
    i = len(S)-1
    while(True):
        num[i] = num[i+1]+1
        i-=1
        if(S[i] == '<'):
            break
    index0.pop(-1)
while(len(index0)>0):
        for i in reversed(range(0,index0[0])):
            if(S[i] == '<'):
                break
            num[i] = max(num[i],num[i+1]+1)
        for i in range(index0[0]+1,len(S)+1):
            num[i] = max(num[i],num[i-1]+1)
            if(i >= len(S)):break
            if(S[i]== '>'):break
        index0.pop(0)

ans = 0
for i in range(len(num)):
    ans += num[i]
print(ans)


### FIXED CODE ###

S = list(map(str,input()))
# s = "><<<<><<"
# S = list(map(str,s))
num = [-1]*(len(S)+1)
index0 = list()
than = 0# 0 == >, 1 == <
#----------------------------------------
for i in range(len(S)):
    if(S[i] == '<'):
        if(than == 0):
            num[i] = 0
            index0.append(i)
        than = 1
    else:
        than = 0
if(S[-1] == '>'):
    num[-1] = 0
    index0.append(len(S)+1)
#--------------------------------------
if(index0[0] == 0):
    i = 1
    while(True):
        num[i] = num[i-1]+1
        if(i >= len(S)):break
        if(S[i] == '>'):
            break
        i+=1
    index0.pop(0)
if(len(index0)>0):
    if(index0[-1] == len(S)+1):
        i = len(S)-1
        while(True):
            num[i] = num[i+1]+1
            i-=1
            if(i < 0):break
            if(S[i] == '<'):break
        index0.pop(-1)

while(len(index0)>0):
        for i in reversed(range(0,index0[0])):
            if(S[i] == '<'):
                break
            num[i] = max(num[i],num[i+1]+1)
        for i in range(index0[0]+1,len(S)+1):
            num[i] = max(num[i],num[i-1]+1)
            if(i >= len(S)):break
            if(S[i]== '>'):break
        index0.pop(0)

ans = 0
for i in range(len(num)):
    ans += num[i]
print(ans)