Harryxun/stf_run huggingface dataset:
s = input()

n = int(s)

answer = []

x = 1
answer.append(x)

while (x * x < n):
    x += 1
    answer.append(x * x)

p = answer.pop()
ans = answer.pop()

print(ans)

### FIXED CODE ###

s = input()

n = int(s)

answer = []

x = 1
answer.append(x)

while (x * x <= n):
    x += 1
    answer.append(x * x)

p = answer.pop()
if p == 1:
    print(p)
else:
    ans = answer.pop()
    print(ans)
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_j=list(map(int,str(j)))
        if array_j==reversed(array_j):
            count+=1
print(count)

### FIXED CODE ###

A,B=map(int,input().split())
count=0
for i in range(A,B+1):
        if str(i)==str(i)[::-1]:
            count+=1
print(count)
import numpy as np
#かけて最小公倍数になる　そのために必要な数がB
from fractions import gcd
N=int(input())
mod=10**9+7
A=list(map(int, input().split()))
def lcm(a,b):
  return (a*b)/gcd(a,b)

LCM=lcm(A[0],A[1])
#LCM%=mod
for i in range(2,N):
  LCM=lcm(LCM, A[i])
  #LCM%=mod
  
#print(LCM)
A=np.array(A)
print(int(((LCM/A)%mod).sum()%mod))




### FIXED CODE ###


#かけて最小公倍数になる　そのために必要な数がB
from fractions import gcd
N=int(input())
if N==1:
  print(1)
  exit()

mod=10**9+7
A=list(map(int, input().split()))
def lcm(a,b):
  return a//gcd(a,b)*b

if N==2:
  LCM=lcm(A[0],A[1])
  ans=((LCM//A[0])+(LCM//A[1]))%mod
  print(ans)
  exit()

LCM=1
#LCM%=mod
for a in A:
  LCM=lcm(LCM, a)
  #LCM%=mod
  
#print(LCM)
ans=0
for a in A:
  ans+=LCM//a
  #ans%=mod

print(int(ans%mod))
N = int(input())
A = list(map(int,input().split()))

p = [a for a in A if a>=0]
n = [a for a in A if a<0]

ans = []
if len(n) == 0:
    p.sort()
    x = p.pop(0)
    y = p.pop()
    ans.append('{} {}'.format(x,y))
    n.append(x-y)
if len(p) == 0:
    n.sort()
    x = n.pop()
    y = n.pop(0)
    ans.append('{} {}'.format(x,y))
    p.append(x-y)

x = n.pop()
while len(p)>1:
    y = p.pop()
    ans.append('{} {}'.format(x,y))
    x -= y
y = x
x = p[0]
ans.append('{} {}'.format(x,y))
x -= y
while n:
    y = n.pop()
    ans.append('{} {}'.format(x,y))
    x -= y

print(x)
for s in ans:
    print(s)


### FIXED CODE ###

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

if N == 2:
    print(max(A)-min(A))
    print('{} {}'.format(max(A),min(A)))
else:
    p = [a for a in A if a>=0]
    n = [a for a in A if a<0]

    ans = []
    if len(n) == 0:
        p.sort()
        x = p.pop(0)
        y = p.pop()
        ans.append('{} {}'.format(x,y))
        n.append(x-y)
    if len(p) == 0:
        n.sort()
        x = n.pop()
        y = n.pop(0)
        ans.append('{} {}'.format(x,y))
        p.append(x-y)

    x = n.pop()
    while len(p)>1:
        y = p.pop()
        ans.append('{} {}'.format(x,y))
        x -= y
    y = x
    x = p[0]
    ans.append('{} {}'.format(x,y))
    x -= y
    while n:
        y = n.pop()
        ans.append('{} {}'.format(x,y))
        x -= y

    print(x)
    for s in ans:
        print(s)
#!/usr/bin/env python3
#ABC111 C

from operator import itemgetter
n = int(input())
v = list(map(int,input().split()))

s = []
t = []
for i in range(n):
    if i % 2 == 0:
        s.append(v[i])
    else:
        t.append(v[i])

ss = list(set(s))
tt = list(set(t))

sc = []
tc = []
for i in range(len(ss)):
    sc.append([ss[i],s.count(ss[i])])
    tc.append([tt[i],t.count(tt[i])])
sc.sort(key = itemgetter(1))
tc.sort(key = itemgetter(1))
if sc[-1][0] == tc[-1][0]:
    if len(sc) == 1 and len(tc) == 1:
        print(n - sc[-1][1])
    elif len(sc) == 1 and len(tc) != 1:
        print(n - sc[-1][1] - tc[-2][1])
    elif len(sc) != 1 and len(tc) == 1:
        print(n - sc[-2][1] - tc[-1][1])
    else:
        ma = max(sc[-2][1],tc[-2][1])
        print(n - sc[-1][1] - ma)
else:
    print(n - sc[-1][1] - tc[-1][1])


### FIXED CODE ###

#!/usr/bin/env python3
#ABC111 C

from operator import itemgetter
import collections

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

s = [v[i] for i in range(n) if i % 2 == 0]
t = [v[i] for i in range(n) if i % 2 == 1]

sc = collections.Counter(s)
tc = collections.Counter(t)
sc = list(sc.items())
tc = list(tc.items())
ls = len(sc)
lt = len(tc)
sc.sort(key = itemgetter(1))
tc.sort(key = itemgetter(1))
if sc[-1][0] == tc[-1][0]:
    if ls == 1 and lt == 1:
        print(n - sc[-1][1])
    elif ls == 1 and lt != 1:
        print(n - sc[-1][1] - tc[-2][1])
    elif ls != 1 and lt == 1:
        print(n - sc[-2][1] - tc[-1][1])
    else:
        ma = max(sc[-2][1],tc[-2][1])
        print(n - sc[-1][1] - ma)
else:
    print(n - sc[-1][1] - tc[-1][1])
a, b = map(int, input().spoit())
print((a + b + 1) // 2)

### FIXED CODE ###

a, b = map(int, input().split())
print((a + b + 1) // 2)
# AOJ 0069: Drawing Lots II
# Python3 2018.6.28 bal4u

while True:
	n = int(input())
	if n == 0: break
	m, p, d = [int(input()) for i in range(3)]
	a = [[0 for j in range(10)] for i in range(32)]
	for i in range(1, d+1): a[i] = [0] + list(map(int, input())) + [0]
	s = [[0 for j in range(10)] for i in range(32)]
	for i in range(1, n+1): s[d+1][i] = i
	for i in range(d, 0, -1):
		for j in range(1, n+1): s[i][j] = s[i+1][j]
		for j in range(1, n):
			if a[i][j]: s[i][j], s[i][j+1] = s[i][j+1], s[i][j]
	k = s[1][m]
	if k == p:
		print(0)
		continue
	f = False
	for i in range(1, d+1):
		for j in range(1, n):
			if ((s[i][j] == k and s[i][j+1] == p) or (s[i][j] == p and s[i][j + 1] == k)) \
				and a[i][j-1] == 0 and a[i][j] == 0 and a[i][j+1] == 0:
				print(i, j)
				f = True
				break
		if f: break
	if not f: print(1)


### FIXED CODE ###

# AOJ 0069: Drawing Lots II
# Python3 2018.6.28 bal4u

while True:
	n = int(input())
	if n == 0: break
	m, p, d = [int(input()) for i in range(3)]
	m -= 1
	p -= 1
	a = [[] for i in range(d+1)]
	for i in range(d): a[i] = list(map(int, input()))
	s = [[0 for j in range(n)] for i in range(d+1)]
	s[d] = [i for i in range(n)]
	for i in range(d-1, -1, -1):
		for j in range(n): s[i][j] = s[i+1][j]
		for j in range(n-1):
			if a[i][j]: s[i][j], s[i][j+1] = s[i][j+1], s[i][j]
	k = s[0][m]
	if k == p:
		print(0)
		continue
	f = False
	for i in range(d):
		for j in range(n-1):
			if ((s[i][j] == k and s[i][j+1] == p) or (s[i][j] == p and s[i][j+1] == k)) \
				and (j == 0 or a[i][j-1] == 0) and a[i][j] == 0 and (j == n-2 or a[i][j+1] == 0):
				print(i+1, j+1)
				f = True
				break
		if f: break
	if not f: print(1)
prime=[3,5,7,11,13]
x=[]
for i in range(5):
	for j in range(i):
		for k in range(j):
			if n >= i*j*k:
				x.append(i*j*k)
cnt=len(x)
if 189> n >= 135:
	cnt += 1
elif n >= 189:
	cnt += 2
else:
	pass
print(cnt)
	
	

### FIXED CODE ###

n=int(input())
p=[3,5,7,11,13]
x=[]
for i in range(5):
	for j in range(i):
		for k in range(j):
			if n >= p[i]*p[j]*p[k]:
				x.append(i*j*k)
cnt=len(x)
if 135 <= n < 189:
	cnt += 1
elif 189 <= n:
	cnt += 2
else:
	pass
print(cnt)
s = int(input())
an = []
an.append(s)
n = s
while an.count(1 or 2 or 4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)


### FIXED CODE ###

x, y, z = map(int, input().split())
print(int(x * y / 2))
def resolve():
    S = input()
    T = input()

    if re.match(r'[a-z]{1,10}', S) and re.match(S + '.', T):
        print('Yes')
        return

    print('No')

resolve()

### FIXED CODE ###

import re

def resolve():
    S = input()
    T = input()

    if 1 <= len(S) and len(S) <= 10:
        if re.match(S + '.', T):
            print('Yes')
            return

    print('No')


resolve()
inpl = lambda: list(map(int,input().split()))
N, M = inpl()
A = inpl()
A.sort(reverse=True)
L = list(map(lambda a: len(bin(a)-2),A))
L.append(0)
l = L[0]
P = []
D = []
for i in range(1,N):
    if L[i] == l:
        continue
    elif i > M:
        break
    else:
        d = L[i] - l
        r = M // i
        if d < r:
            P.append(i)
            D.append(d)
            M -= d*i
        else:
            P.append(i)
            D.append(r)
            M -= r*i
            break
c = 0
E = [0]
for dd in D:
    E.append(E[-1]+dd)
i = 0
for n in range(len(P)):
    while i < P[n]:
        A[i] <<= E[-i-1]
        i += 1
A.sort(reverse=True)
for m in range(M):
    A[m] <<= 1

print(sum(A))

### FIXED CODE ###

import heapq
inpl = lambda: list(map(int,input().split()))
N, M = inpl()
A = inpl()
q = []
for a in A:
    heapq.heappush(q,-a)
for _ in range(M):
    a = -heapq.heappop(q)
    a //= 2
    heapq.heappush(q,-a)
print(-sum(q))
n,k = map(int,input().split())



for i in range(k):
    if 0 > n-k+1:
        print(ans2)

    else:
        total = 1
        total2 = 1
        total3 = 1
        for j in range(i+1):
            total *= n-k+1-j
            total2 *= j+1
            total3 = int(total/total2)
            
        ww = (i+1)**(k-i-1)
        ans = ww * total3

        ans2 = ans % 1000000007

        print(ans2)
    


### FIXED CODE ###

n,k = map(int,input().split())
mod = 10**9+7

a = [1 for i in range(2010)]

memo = 1
for i in range(1,2001):
    memo *= i
    a[i] = memo



for i in range(1,k+1):
    if not((n-k+2 > i)):
        print(0)

    else:
        memo1 = a[n-k+1]*a[k-1]
        memo2 = a[i]*a[n-k+1-i]*a[i-1]*a[k-i]

        ans2 = memo1//memo2
        print(ans2%mod)
N, K = map(int, input().split())
A = list(map(int, input().split()))

K = min(K, 100)
for _ in range(K):
    B = [0 for _ in range(A)]
    for i in range(N):
        l = max(0, i - A[i])
        r = min(N - 1, i + A[i])
        B[l] += 1
        if r+1 < N:
            B[r+1] -= 1
    
    for i in range(1, N):
        B[i] += B[i-1]
    
    A = B.copy()

print(" ".join(map(str, A)))

### FIXED CODE ###

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

for _ in range(K):
    B = [0] * N
    for i, d in enumerate(A):
        l = max(0, i-d)
        r = min(N-1, i+d)
        B[l] += 1
        if r+1 < N:
            B[r+1] -= 1
    
    for i in range(1, N):
        B[i] += B[i-1]
    
    A = B.copy()
    if min(A) == N:
        break

print(" ".join(map(str, A)))
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

def dfs(x):
    for p in g[x]:
        # print(p[0])
        if color[p[0]] != -1:
            continue
        if p[1] % 2: #odd
            if color[x]: #pre=white
                color[p[0]] = 0
            else:
                color[p[0]] = 1
        else:
            if color[x]: #pre=white
                color[p[0]] = 1
            else:
                color[p[0]] = 0
        dfs(p[0])
n = inp()
g = [[] for i in range(n)]
#0:黒 1:白 -1:未訪問
color = [-1] * n

for i in range(n-1):
    u,v,w = inpl()
    g[u-1].append([v-1,w])
    g[v-1].append([u-1,w])
# print(g)
color[0] = 0
dfs(0)
for i in range(1,n):
    if color[i] != -1:
        continue
    dfs(i)
for i in range(n):
    print(color[i])

### FIXED CODE ###

from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

def dfs(x):
    for p in g[x]:
        # print(p[0])
        if color[p[0]] != -1:
            continue
        if p[1] % 2: #odd
            if color[x]: #pre=white
                color[p[0]] = 0
            else:
                color[p[0]] = 1
        else:
            if color[x]: #pre=white
                color[p[0]] = 1
            else:
                color[p[0]] = 0
        dfs(p[0])
n = inp()
g = [[] for i in range(n)]
#0:黒 1:白 -1:未訪問
color = [-1] * n

for i in range(n-1):
    u,v,w = inpl()
    g[u-1].append([v-1,w])
    g[v-1].append([u-1,w])
# print(g)
color[0] = 0
dfs(0)
for i in range(1,n):
    if color[i] != -1:
        continue
    dfs(i)
for i in range(n):
    print(color[i])
# -*- coding: utf-8 -*-
"""
Created on Sun May 31 18:36:13 2020

@author: NEC-PCuser
"""
n = int(input())
l = list(map(int, input().split()))
dic_gusu = {}
dic_kisu = {}

for i in range(0, n):
    if (i % 2 == 0):
        if (l[i] in dic_gusu):
            dic_gusu[l[i]] += 1
        else:
            dic_gusu[l[i]] = 1
    if (i % 2 == 1):
        if (l[i] in dic_kisu):
            dic_kisu[l[i]] += 1
        else:
            dic_kisu[l[i]] = 1
dic_kisu = sorted(dic_kisu.items(), key = lambda x : x[1])
dic_gusu = sorted(dic_gusu.items(), key = lambda x : x[1])

count = 0
if (len(dic_kisu) == 1 and len(dic_gusu) == 1 and dic_kisu[len(dic_kisu) - 1][0] == dic_gusu[len(dic_gusu) - 1][0]):
    count = n // 2
elif (dic_kisu[len(dic_kisu) - 1][0] != dic_gusu[len(dic_gusu) - 1][0]):
    for i in range(0, len(dic_kisu) - 1):
        count += dic_kisu[i][1]
    for i in range(0, len(dic_gusu) - 1):
        count += dic_gusu[i][1]
else:
    for i in range(0, len(dic_kisu)):
        count += dic_kisu[i][1]
    for i in range(0, len(dic_gusu)):
        count += dic_gusu[i][1]
    count_tmp = count
    count_ans = count_tmp - dic_kisu[len(dic_kisu) - 1][1] - dic_kisu[len(dic_gusu) - 2][1] 
    count_ans2 = count_tmp  - dic_kisu[len(dic_kisu) - 2][1] - dic_kisu[len(dic_gusu) - 1][1]
    count = min([count_ans, count_ans2])    
        
print(count)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun May 31 18:36:13 2020

@author: NEC-PCuser
"""
n = int(input())
l = list(map(int, input().split()))
dic_gusu = {}
dic_kisu = {}

for i in range(0, n):
    if (i % 2 == 0):
        if (l[i] in dic_gusu):
            dic_gusu[l[i]] += 1
        else:
            dic_gusu[l[i]] = 1
    if (i % 2 == 1):
        if (l[i] in dic_kisu):
            dic_kisu[l[i]] += 1
        else:
            dic_kisu[l[i]] = 1
dic_kisu = sorted(dic_kisu.items(), key = lambda x : x[1])
dic_gusu = sorted(dic_gusu.items(), key = lambda x : x[1])

count = 0
if (len(dic_kisu) == 1 and len(dic_gusu) == 1 and dic_kisu[len(dic_kisu) - 1][0] == dic_gusu[len(dic_gusu) - 1][0]):
    count = n // 2
elif (dic_kisu[len(dic_kisu) - 1][0] != dic_gusu[len(dic_gusu) - 1][0]):
    for i in range(0, len(dic_kisu) - 1):
        count += dic_kisu[i][1]
    for i in range(0, len(dic_gusu) - 1):
        count += dic_gusu[i][1]
else:
    for i in range(0, len(dic_kisu)):
        count += dic_kisu[i][1]
    for i in range(0, len(dic_gusu)):
        count += dic_gusu[i][1]
    count_tmp = count
    count_ans = count_tmp - dic_kisu[len(dic_kisu) - 1][1] - dic_gusu[len(dic_gusu) - 2][1] 
    count_ans2 = count_tmp  - dic_kisu[len(dic_kisu) - 2][1] - dic_gusu[len(dic_gusu) - 1][1]
    count = min([count_ans, count_ans2])    
        
print(count)
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      ans = 'APPROVED'
    else:
      print('DENIED')
      exit()
print(ans)
    

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 'APPROVED'
for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      ans = 'APPROVED'
    else:
      print('DENIED')
      exit()
print(ans)
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)] # 親の番号
        self.size = [1]*n
    
    def root(self, x: int) -> int:
        """根を求める"""
        if self.par[x] == x: # if root
            return x
        else:
            self.par[x] = self.root(self.par[x]) # 経路圧縮
            return self.par[x]
    
    def is_same(self, x:int, y:int)->bool:
        """x と y が同じ集合に属するか否か"""
        return self.root(x)==self.root(y)
    
    def unite(self, x:int, y:int):
        """x と y の属する集合を併合"""
        x = self.root(x)
        y = self.root(y)
        if x == y: return
        self.par[x] = y
        self.size[y] += self.size[x]
        self.size[x] = 0
        
    def get_size(self, x:int)->int:
        return self.size[self.root(x)]
        
N,M = map(int, input().split())
ab = tuple(tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M))

def comb2(n):
    if n==0: return 0
    return n*(n-1)//2

uf = UnionFind(N)
ans = []
nex = comb2(N)
for ai,bi in reversed(ab):
    ans.append(nex)
    if uf.is_same(ai,bi):
        nex = nex
    else:
        nex = nex - uf.get_size(ai)*uf.get_size(bi)
        uf.unite(ai,bi)
for a in reversed(ans):
    print(a)

### FIXED CODE ###

#UnionFindクラス
class UnionFind:
    def __init__(self,n):
        self.par =  [i for i in range(n)]
        self.rank = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # xとyの根を結合させる
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y: return
        if self.rank[x] < self.rank[y]:
            x, y = y, x
        self.rank[x] += self.rank[y]
        self.par[y] = x

    # x,yの根が同じかどうかを返す（根が同じ:True、根が異なる:False）
    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    # xが含まれる木の要素数を返す
    def size(self, x):
        return self.rank[self.find(x)]
    
n,m = map(int,input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(m)]
uf = UnionFind(n)
accm = []
for ai,bi in reversed(ab):
    if uf.is_same(ai,bi):
        accm.append(0)
    else:
        accm.append(uf.size(ai)*uf.size(bi))
    uf.union(ai,bi)

accm = accm[::-1]
for i in range(1,len(accm)):
    accm[i] += accm[i-1]
for a in accm:
    print(a)
n=int(input())
a=list(map(int,input().split()))
ans=0
while 1:
    for i in range(n):
        if a[i]%2:
            print(ans)
            exit()
        a[i]//=2
    ans+=1

### FIXED CODE ###

s=input()
ans=0
for i in range(3):
    if s[i]=="1":
        ans+=1
print(ans)
N = int(input())
p = []

for i in range(N):
    p.append(int(input()))

total_price = max(N) / 2 + sum(N) - max(N)

print(total_price)

### FIXED CODE ###

import math
N = int(input())
p = []

for i in range(N):
    p.append(int(input()))

total_price = max(p) / 2 + sum(p) - max(p)

print(math.floor(total_price))
import sys
inputs = sys.stdin.readline
N, Q= map(int,inputs().split())
V = [list(map(int,inputs().split())) for p in [0]*N]

for q in [0]*Q:
	m = int(inputs())
	for n in range(N):
		if V[n][0] - V[n][2] <=m and m <= V[n][1] - V[n][2] -1:
			print(V[n][2])
			break
	else:
		print(-1)


### FIXED CODE ###

import sys
input = sys.stdin.readline
a,p = map(int,input().split())
ans = (3*a + p)//2
print(ans)
def main():
    N = int(input())
    posi = [0, 0]
    time = 0
    flag = True
    for i in range(N):
        t, x, y = (int(i) for i in input().split())
        move = abs(posi[0] - x) + abs(posi[1] - y)
        if (t - time) >= move and (t - time) % move:
            flag = False
        time = t
        posi = [x, y]
    if flag:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = int(input())
    txy = [[0,0,0]] + [[int(i) for i in input().split()] for j in range(N)]
    for i in range(1,N+1):
        cur_distance = abs(txy[i][1] - txy[i-1][1]) + abs(txy[i][2] - txy[i-1][2])
        t_diff = txy[i][0] - txy[i-1][0]
        if t_diff < cur_distance or t_diff%2 != cur_distance%2:
            print("No")
            break
    else:
        print("Yes")
if __name__ == '__main__':
    main()
def main():
    line = input()

    s1 = []
    s2 = []
    sum = 0
    for i, s in enumerate(line):
        if s == "\\":
            # 谷の位置をスタックに積む
            s1.append(i)
        elif s == "/" and len(s1) > 0:
            # 山で対応する谷があるなら、面積に追加
            j = s1.pop()
            sum += i - j  # 谷から山の距離を水たまりの面積に追加
            # jより前に位置する水たまりの面積を追加
            a = i - j
            while len(s2) > 0 and s2[-1][0] > j:
                a += s2.pop()[1]
            # (水たまりの左端の位置, 水たまりの面積)のタプルをスタックに積む
            s2.append((j, a))

    print(sum)
    print(len(s2), s2[0][1])


if __name__ == "__main__":
    main()



### FIXED CODE ###

def main():
    line = input()
    s1 = []
    s2 = []
    sum = 0
    for i, s in enumerate(line):
        if s == "\\":
            # 谷の位置をスタックに積む
            s1.append(i)
        elif s == "/" and len(s1) > 0:
            # 山で対応する谷があるなら、面積に追加
            j = s1.pop()
            sum += i - j  # 谷から山の距離を水たまりの面積に追加
            # jより前に位置する水たまりの面積を追加
            a = i - j
            while len(s2) > 0 and s2[-1][0] > j:
                a += s2.pop()[1]
            # (水たまりの左端の位置, 水たまりの面積)のタプルをスタックに積む
            s2.append((j, a))

    print(sum)
    print(len(s2), end="")
    for x in s2:
        print(f" {x[1]}", end="")
    print()


if __name__ == "__main__":
    main()
s = input()
n = len(s) #length s
aa = ['.'] * (n + 1)

if s[0] == '<':
  aa[0] = 0

for i in range(n-1):
  if s[i] ==  '>' and s[i+1] == '<':
    aa[i+1] = 0 
  elif s[i] == '<' and s[i+1] == '>':
    aa[i+1] = n
    
id0 = [i for i,x in enumerate(aa) if x == 0]
idm = [i for i, x in enumerate(aa) if x == n]


for i in range(len(id0)-1):
  aa[idm[i]] = max(idm[i]-id0[i], id0[i+1]-idm[i])

for i in range(n):
  if s[i] == '<' and aa[i+1] == '.':
    aa[i+1] = aa[i] + 1
for i in range(n-1, 0,-1):
  if aa[i] == '.' and s[i] == '>':
    aa[i] = aa[i+1] +1

print(sum(aa))

### FIXED CODE ###

s = input()
n = len(s) #length s
aa = ['.'] * (n + 1)

if s[0] == '<':
  aa[0] = 0
if s[-1] == '>':
  aa[-1] = 0

for i in range(n-1):
  if s[i] ==  '>' and s[i+1] == '<':
    aa[i+1] = 0 
  elif s[i] == '<' and s[i+1] == '>':
    aa[i+1] = n
    
z = [i for i,x in enumerate(aa) if x == 0]
m = [i for i, x in enumerate(aa) if x == n]


for i in range(len(z)-1):
  aa[m[i]] = max(m[i]-z[i], z[i+1]-m[i])
  aa[m[i]+1] = z[i+1]-m[i]-1
  for j in range(z[i]+1, m[i]):
    aa[j] = aa[j-1] +1
  for k in range(m[i]+2,z[i+1]):
    
    aa[k] = aa[k-1]-1
for i in range(z[-1], n+1):
  if aa[i] == '.':
    aa[i] = aa[i-1]+1
for i in range(z[0]):
  if aa[i] == '.':
    aa[i] = z[0] - i
    

print(sum(aa))
x = raw_input()
x = x**3
print x

### FIXED CODE ###

x=input()
x=x**3
print x
S = int(input())
W = int(input())
if S > W:
  print("safe")
 else:
  print("unsafe")


### FIXED CODE ###

S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")
N=int(input())
T,A=(int(i) for i in input().split())
Temp=[T-0.006*int(input()) for i in range(N)]
dif=[abs(A-Temp[j]) for j in range (N)]
print(dif.index(min(dif))+1)


### FIXED CODE ###

N=int(input())
T,A=(int(i) for i in input().split())
Hlist=[int(i) for i in input().split()]
Temp=[T-0.006*Hlist[i] for i in range(N)]
dif=[abs(A-Temp[j]) for j in range (N)]
print(dif.index(min(dif))+1)
n = int(input())

for x in range(1, 3500 + 1):
    for y in range(1, 3500 + 1):
        p = n * x * y
        q = 4 * x * y - n * (x + y)
        if p % q == 0:
            print(x, y, p // q)
            exit()

### FIXED CODE ###

N = int(input())

w = -1
flg = False
for h in range(1, 3500 + 1):
    for n in range(h, 3500 + 1):
        q = 4 * n * h - N * (n + h)
        #print(h, n, p, q)
        if q > 0:
            #q == 0: 1/wなしで4/Nに等しくなり不適（w無限大）
            #q < 0: p > 0より、w < 0となり不適
            p = N * n * h
            if p % q == 0:
                w = p // q
                flg = True
                break
    if flg:
        break
print(h, n, w)
a = int(input())
if a==1
 print(0);
else
 print(1);

### FIXED CODE ###

a = int(input())
if a==1:
 print(0)
else:
 print(1)