Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from collections import defaultdict
def main():
    def f(n):
        if n == 0:
            return 0
        if d[n] != 0:
            return d[n]
        d[n] = f(n % bin(n).count('1')) + 1
    n = int(input())
    X = list(input())
    d = defaultdict(int)
    for i in range(1, n):
        f(i)
    c = sum(list(map(int, X)))
    m = int(''.join(X), 2)
    j = 1 << n - 1
    for i in range(n):
        if X[i] == '0':
            print(d[b % (c + 1)] + 1 if (b := m + j) != 0 else 0)
        else:
            print(d[b % (c - 1)] + 1 if (b := m - j) != 0 else 0)
        j = j >> 1

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    def f(n):
        if n == 0: return 0
        return f(n % bin(n).count('1')) + 1
    n = int(input())
    X = list(input())
    c = sum(list(map(int, X)))
    m = int(''.join(X), 2)
    mp, mm = m % (c + 1), m % (c - 1) if c - 1 != 0 else 0
    jp, jm = 1, 1
    ans = [0] * n
    for i in range(n - 1, -1, -1):
        if X[i] == '0':
            mod = c + 1
            ans[i] = f((mp + jp) % mod) + 1
        else:
            ans[i] = f((mm - jm + mod) % mod) + 1 if (mod := c - 1) != 0 else 0
        jp, jm = (jp << 1) % (c + 1), (jm << 1) % (c - 1) if c - 1 != 0 else 0
    [print(a) for a in ans]
if __name__ == '__main__':
    main()
### BUGGY CODE ###

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

I = [0]*N

for i in range(N):
    for j in range(len(A)):
        if A[j] == i:
            I[i-1] += 1


for i in range(N):
    print(I[i])


### FIXED CODE ###

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

I = [0]*N

for i in range(len(A)):
    I[A[i] - 1 ] += 1


for i in range(N):
    print(I[i])
### BUGGY CODE ###

N, K = map(int, input().split(' '))

def absdiff(x, K):
    return abs(x - K)

def culc(N, K):
    if K == 1:
        print(0)
        return

    x = N
    min = x
    while min >= x:
        #print(min, x)
        min = x
        x = absdiff(x, K)

    print(min)
    return


culc(N, K)


### FIXED CODE ###

N, K = map(int, input().split(' '))

def absdiff(x, K):
    return abs(x - K)

def culc(N, K):
    if K == 1:
        print(0)
        return

    if N*2 == K:
        print(N)
        return

    if N%K == 0:
        print(0)
        return

    x = N % K
    min = x
    while min >= x:
        #print(min, x)
        min = x
        x = absdiff(x, K)
        if min == 1:
            break

    print(min)
    return


culc(N, K)
### BUGGY CODE ###

s = input()
l = len(s)
t = [2019] * l
t[l - 1] = int(s[l - 1])
ans = 0

for i in range(l - 1, 0, -1):
    mod = (t[i] + int(s[i - 1]) * 10 ** (l - i)) % 2019
    cnt = t.count(mod)
    t[i - 1] = mod
    if mod == 0:
        ans += 1
    if cnt > 0:
        ans += cnt

print(ans)

### FIXED CODE ###

S = input() [::-1]
ans = 0
mod = 0
ten = 1
count = [0]* 2019
count[0] = 1
for i in range(len(S)):
    mod = (mod + int(S[i]) * ten) % 2019
    ten = ten*10 % 2019
    count[mod] += 1
for c in count:
    ans += c*(c-1)//2
print(ans)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
i=0
for i in range(len(a)):
    print(a.count(i+1))
    print('\n')
print(0)

### FIXED CODE ###

n=int(input())
ans=[0]*n
a=list(map(int,input().split()))
for i in range(n-1):
    ans[a[i]-1]=ans[a[i]-1]+1
for i in ans:
    print(i)
### BUGGY CODE ###

N = int(input())
a = list(map(int,input().split()))
n = 0
for i in range(1,N+1):
    for j in range(N+1-i):
        S = 0
        for x in a[j:j+i]:
            S += x
        if S == 0:
            n += 1
print(n)

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
s = [0]*(len(a)+1)
for i in range(len(a)):
    s[i+1] = s[i] + a[i]
b = {}
for x in s:
    if str(x) not in b:
        b[str(x)] = 1
    else:
        b[str(x)] += 1
n = 0
for x in b:
    n += b[x]*(b[x]-1)/2
print(int(n))
### BUGGY CODE ###

k, s = map(int, input().split())
cont = 0
for x in range(k+1):
    for y in range(k+1):
        if x + y <= s:
            for z in range(k+1):
                if s == (x + y + z):
                    cont += 1
                    break
print(cont)

### FIXED CODE ###

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

cont = 0
for x in range(k+1):
    for y in range(k+1):
        if x + y <= s:
            if s - (x+y) <= k:
                cont += 1
print(cont)
### BUGGY CODE ###

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
P = int(1e9+7)
ans = 0


def comb(n, r):
    if n < r or r < 0:
        return 0
    nume = 1
    deno = 1
    for i in range(1, r + 1):
        nume *= (n - i + 1)
        deno *= (i)
    return nume//deno


combs=[comb(i, K - 1)%P for i in range(N+1)]

for i, a in enumerate(A):
    ans = (ans + a * combs[i]) % P
    ans = (ans - a * combs[N - i - 1]) % P

print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
P = int(1e9+7)
ans = 0

kaizyo = [0]
kaizyo_inv = [0]
tmp = 1
for i in range(1, N+1):
    tmp = (tmp*i) % P
    kaizyo.append(tmp)
    kaizyo_inv.append(pow(tmp, P - 2, P))


def comb(n, r):
    if n < r or n == 0:
        return 0
    elif n == r or r == 0:
        return 1
    else:
        return kaizyo[n] * kaizyo_inv[r] * kaizyo_inv[n - r]


combs=[comb(i, K - 1)%P for i in range(N+1)]

for i, a in enumerate(A):
    ans = (ans + a * combs[i]) % P
    ans = (ans - a * combs[N - i - 1]) % P

print(ans)
### BUGGY CODE ###

import collections
n = int(input())
A = list(map(int, input().split()))

def prime_factorize(n):
    r = []
    while n % 2 == 0:
        r.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            r.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        r.append(n)
    return collections.Counter(r)

fa = collections.Counter()
for a in A:
    fa = fa | prime_factorize(a)

ans = 0
mod = 10**9+7
for a in A:
    t = 1
    fb = fa - prime_factorize(a)
    for k, v in fb.items():
        t *= pow(k, v, mod)
    ans += t % mod
print(ans % mod)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from math import gcd
cm = 1
for i in range(n):
    cm = cm*a[i]//gcd(cm, a[i])
ai = sum(pow(x, mod-2, mod) for x in a)
print(int(ai*cm%mod))
### BUGGY CODE ###

from collections import deque

h, w, k = map(int, input().split())
x1, y1, x2, y2 = map(int, input().split())
x1 -= 1
x2 -= 1
y1 -= 1
y2 -= 1
# C[h][w]
C = [list(input()) for _ in range(h)]

dist = [[10 ** 10] * w for _ in range(h)]

dist[x1][y1] = 0
que = deque([])
que.append((x1, y1))

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

while que:
    a, b = que.popleft()
    d = dist[a][b]
    if a == x2 and b == y2:
        print(dist[x2][y2])
        exit()
    for i in range(4):
        cx = a + dx[i]
        cy = b + dy[i]
        if cx < 0 or cx >= h or cy < 0 or cy >= w:
            continue
        if C[cx][cy] == "@":
            continue
        for j in range(1, k + 1):
            nx = a + dx[i] * j
            ny = b + dy[i] * j
            if nx < 0 or nx >= h or ny < 0 or ny >= w:
                break
            if C[nx][ny] == "@":
                break
            if dist[nx][ny] == 10 ** 10:
                dist[nx][ny] = d + 1
                que.append((nx, ny))
print(-1)


### FIXED CODE ###

from collections import deque

h, w, k = map(int, input().split())
x1, y1, x2, y2 = map(int, input().split())
x1 -= 1
x2 -= 1
y1 -= 1
y2 -= 1
# C[h][w]
C = [list(input()) for _ in range(h)]

dist = [[10 ** 10] * w for _ in range(h)]

dist[x1][y1] = 0
que = deque([])
que.append((x1, y1))

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

while que:
    a, b = que.popleft()
    d = dist[a][b]
    if a == x2 and b == y2:
        print(dist[x2][y2])
        exit()
    for i in range(4):
        cx = a + dx[i]
        cy = b + dy[i]
        if cx < 0 or cx >= h or cy < 0 or cy >= w:
            continue
        if C[cx][cy] == "@":
            continue
        for j in range(1, k + 1):
            nx = a + dx[i] * j
            ny = b + dy[i] * j
            if nx < 0 or nx >= h or ny < 0 or ny >= w:
                break
            if C[nx][ny] == "@":
                break
            if dist[nx][ny] < d + 1:
                break
            if dist[nx][ny] == 10 ** 10:
                dist[nx][ny] = d + 1
                que.append((nx, ny))
print(-1)
### BUGGY CODE ###


#素因数分解（10**6まで）
def soinsu_bunkai(m):
    pf=set()
    mm =m
    for i in pri_num:
        while mm %i==0:
            pf.add(i)
            mm //=i
    if mm !=1:
        pf.add(mm)
    return pf

    # 初期入力
import math
import sys
from collections import Counter
from functools import reduce
input = sys.stdin.readline  #文字列では使わない
N = int(input())
A = list(map(int, input().split()))
intersect =set()
pair_w =set()

# 10**6までの素因数分解するために、「10**6のルート」までの素数を列挙
pri =10**6 +10
sq_pri =int(math.sqrt(pri))
#pri_num =prime_numbers(sq_pri +10 )
pri_num =[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009]

#not coprimeの判定
gcd_a =reduce(math.gcd,A)
if gcd_a !=1:
    ans ="not coprime"

#pairwise coprimeの判定
else:
    for a in A:
        aa =soinsu_bunkai(a)
        if intersect & aa:
            pair_w.add(0)
            break #共通要素があったらpair_wではない→set_w
        else:
            pair_w.add(1)
        intersect |=aa

    if 0 in pair_w:
        ans ="setwise coprime"        
    else:
        ans ="pairwise coprime"
print(ans)

### FIXED CODE ###

#高速素因数分解  osa_k法 
def osa_k(a):
    tmp = set()
    while a > 1:
        tmp.add(sieve[a])
        a //= sieve[a]
    return tmp

    # 初期入力
import math
import sys
from bisect import bisect_left
from functools import reduce
input = sys.stdin.readline  #文字列では使わない
N = int(input())
A = list(map(int, input().split()))
used =set()

#not coprimeの判定
gcd_a =reduce(math.gcd,A)
if gcd_a !=1:
    ans ="not coprime"

#pairwise coprimeの判定
else:
    MAXN =10**6 +10
    #osa_k法
    sieve = [i for i in range(MAXN+1)]
    p = 2
    while p*p <= MAXN:
        if sieve[p] == p:
            for q in range(2*p,MAXN+1,p):
                if sieve[q] == q:
                    sieve[q] = p
        p += 1
    
    ans ="pairwise coprime"
    for a in A:
        aa =osa_k(a)
        if used & aa:
            ans ="setwise coprime"
            break #共通要素があったらpair_wではない→set_w
        used |=aa
    
print(ans)
### BUGGY CODE ###

N = int(input())
As = list(map(int,input().split()))
As.sort(reverse=True)
first_d = As[0]
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

first = make_divisors(As[0])
second = make_divisors(As[1])
first_second = list(set(first) & set(second))
first_second.sort(reverse=True)
for d in range(len(first_second)):
    cnt = 0
    for i in range(N):
        if As[i] % (first_second[d]) == 0:
            cnt += 1
    if cnt >= N-1:
        ans_a = first_second[d]
        break
if N == 2:
    print(max(As))
else:
    third  = make_divisors(As[2])
    
    first_third = list(set(first) & set(third))
    first_third.sort(reverse=True)
    second_third = list(set(third) & set(second))
    second_third.sort(reverse=True)
    for d in range(len(first_second)):
        cnt = 0
        for i in range(N):
            if As[i] % (first_second[d]) == 0:
                cnt += 1
        if cnt >= N-1:
            ans_a = first_second[d]
            break
    for d in range(len(first_third)):
        cnt = 0
        for i in range(N):
            if As[i] % (first_third[d]) == 0:
                cnt += 1
        if cnt >= N-1:
            ans_b = first_third[d]
            break
    for d in range(len(second_third)):
        cnt = 0
        for i in range(N):
            if As[i] % (second_third[d]) == 0:
                cnt += 1
        if cnt >= N-1:
            ans_c = second_third[d]
            break
    print(max(ans_a,ans_b,ans_c))
#for d in range(first_d):
#    cnt = 0
#    for i in range(N):
#        if As[i] % (first_d-d) == 0:
#            cnt += 1
#    if cnt >= N-1:
#        ans = first_d-d
#        break
#print(ans)


### FIXED CODE ###

N = int(input())
As = list(map(int,input().split()))
As.sort(reverse=True)
first_d = As[0]
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

if N == 2:
    print(max(As))
else:
    first = make_divisors(As[0])
    second = make_divisors(As[1])
    third  = make_divisors(As[2])
    div_list = list((set(first) & set(second)) | (set(first) & set(third)) | (set(third) & set(second)))
    div_list.sort(reverse=True)
    
    for d in range(len(div_list)):
        cnt = 0
        for i in range(N):
            if As[i] % (div_list[d]) != 0:
                cnt += 1
                if cnt > 1:
                    break
        if cnt <= 1 :
            ans = div_list[d]
            break
    print(ans)
### BUGGY CODE ###

n = int(input(''))
alist = list(map(int,input('').split(' ')))

result=1
for a in alist:
    result*= a

if result <= 10**18:
    print(result)
else:
    print('-1')


### FIXED CODE ###

n = int(input(''))
alist = list(map(int,input('').split(' ')))

if 0 in alist:
    result=0
else:
    result=1
    for a in alist:
        result*= a
        if result > 10**18:
            result = -1
            break

print(result)
### BUGGY CODE ###

# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
def main(N, A):
    ans = 0
    for i, a in enumerate(A):
        l = r = i
        while l >= 0 and A[l] >= a: l -= 1
        while r < N and A[r] >= a: r += 1
        ans += a * (i - l) * (r - i)
    print(ans)

if __name__ == '__main__':
    input = sys.stdin.readline
    N = int(input())
    *A, = map(int, input().split())
    main(N, A)


### FIXED CODE ###

# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
def main(N, A):
    ans = 0
    Ai = [(a, i + 1) for i, a in enumerate(A)]
    Ai.sort(key=lambda x: x[0])
    st = SegmentTree(n=N + 2, f=lambda x, y: x + y)
    st.set_val(0, 1)
    st.set_val(N + 1, 1)
    for a, i in Ai:
        lc = st.query(0, i)
        l = st.bisect_left(lambda x: x < lc)
        r = st.bisect_left(lambda x: x < lc + 1)
        ans += a * (i - l) * (r - i)
        st.set_val(i, 1)
    print(ans)

class SegmentTree:
    def __init__(self, n=None, f=max, identity_factory=int, initial_values=None):
        assert(n or initial_values)
        size = n if n else len(initial_values)
        d = [identity_factory() for _ in range(2 * size + 1)]
        self.__n, self.__d, self.__f, self.__e = size, d, f, identity_factory
        if initial_values:
            for i, v in enumerate(initial_values): d[size + i] = v
            for i in range(size - 1, 0, -1): d[i] = f(d[i << 1], d[i << 1 | 1])

    def get_val(self, index):
        return self.__d[index + self.__n]

    def set_val(self, index, new_value):
        i, d, f = index + self.__n, self.__d, self.__f
        if d[i] == new_value: return
        d[i] = new_value
        i = i >> 1
        while i:
            d[i] = f(d[i << 1], d[i << 1 | 1])
            i = i >> 1

    def modify(self, index, value):
        self.set_val(index, self.__f(self.__d[index + self.__n], value))

    def query(self, from_inclusive, to_exclusive):
        ans = self.__e()
        if to_exclusive <= from_inclusive: return ans
        l, r, d, f = from_inclusive + self.__n, to_exclusive + self.__n, self.__d, self.__f
        while l < r:
            if l & 1: ans, l = f(ans, d[l]), l + 1
            if r & 1: ans, r = f(d[r - 1], ans), r - 1
            l, r = l >> 1, r >> 1
        return ans

    def bisect_left(self, func):
        '''func()がFalseになるもっとも左のindexを探す
        '''
        i, n, f, d, v = 1, self.__n, self.__f, self.__d, self.__e()
        i = n
        j = n + n
        while i < j:
            if i & 1:
                nv = f(v, d[i])
                if not func(nv):
                    break
                v = nv
                i += 1
            i >>= 1
            j >>= 1
        while i < n:
            nv = f(v, d[i << 1])
            if func(nv):
                v, i = nv, i << 1 | 1
            else:
                i = i << 1
        return i - n

if __name__ == '__main__':
    input = sys.stdin.readline
    N = int(input())
    *A, = map(int, input().split())
    main(N, A)
### BUGGY CODE ###

def main():
  s = input()
  n = len(s)
  num = 2019
  ans = 0
  for i in range(n-4):
    for j in range(i+5,n+1):
      a = int(s[i:j])
      if a%num == 0:
        ans += 1
  print(ans)
main()

### FIXED CODE ###

def main():
  s = input()[::-1]
  l = len(s)
  n = 2019
  dp = [0]*n
  wk = 0
  r = 1
  for i in range(l):
    wk += int(s[i])*r
    wk %= n
    dp[wk] += 1
    r*= 10
    r %= n
  print(dp[0]+sum([i*(i-1)//2 for i in dp]))
main()
### BUGGY CODE ###

l=int(input())

list=[]
for i in range(l):
    a=int(input())
    if a in list:
        list.remove(a)
    else:
        list.append(a)

print(len(list))

### FIXED CODE ###

l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)
### BUGGY CODE ###

import itertools

number_str = '999999999'
number_int = int(number_str)

count = 0


length = len(number_str)



def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def calc_pre(leng_pre):
    global count
    count += pow(3, leng_pre) + 3 -  3 * pow(2, leng_pre)

def calc_all(length):
    global count
    l = ['3', '5', '7']
    pre_data = set()
    for v in itertools.combinations_with_replacement(l, length):
        # print(v)
        if'3' in v and '5' in v and '7' in v:
            for vv in itertools.permutations(list(v), length):
                aaa = int(''.join(list(vv)))
                if aaa < number_int:
                    if aaa not in pre_data:
                        # print(aaa)
                        count += 1
                        pre_data.add(aaa)
                else:
                    break

if length > 3:
    for i in range(3, length):
        calc_pre(i)

calc_all(length)

print(count)

# print(pow(2, 3))


### FIXED CODE ###


ans = 0

def check(num_str):
    for i in ['7', '5', '3']:
        if i not in num_str:
            return 0
    return 1

def make_data(num, num_str):
    global ans
    if num < int(num_str):
        return
    if check(num_str):
        ans += 1

    make_data(num, num_str + '7')
    make_data(num, num_str + '5')
    make_data(num, num_str + '3')


def main():
    num = int(input())
    make_data(num, '0')

    global ans
    print(ans)


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


N=int(input())
l = input()
mi = 300000

for i in range(N):
    count=0
    for j in range(N):
        if i>j:
            if l[j]=="W":
                count+=1
        elif i<j:
            if l[j]=="E":
                count+=1
        else:
            continue
    mi=min(mi,count)

print(mi)

### FIXED CODE ###

N=int(input())
l = input()
count0 = l[1:].count("E")
count=count0
mi=count0
for i in range(1, N):
    if l[i-1]=="W":
        count+=1
    if l[i]=="E":
        count-=1
    mi=min(mi,count)
print(mi)
### BUGGY CODE ###

N,X = map(int,input().split())
S = list(map(int,input().split()))
S.sort()
mod = 10**9+7

def E(x,n):
    if n==0:
        return x
    else:
        return (E(x%S[n-1],n-1)+(n-1)*E(x,n-1))%mod

print(E(X,N))

### FIXED CODE ###

from collections import defaultdict
N,X = map(int,input().split())
S = list(map(int,input().split()))
S.sort()
mod = 10**9+7

fact_memo = [0]*201
fact_memo[0] = 1
def fact(n):
    if fact_memo[n] == 0:
        fact_memo[n] = n*fact(n-1)%mod
    return fact_memo[n]

fact_inv_memo = [0]*201
fact_inv_memo[0] = 1
def fact_inv(n):
    if fact_inv_memo[n] == 0:
        fact_inv_memo[n] = pow(fact(n),mod-2,mod)
    return fact_inv_memo[n]

dp = defaultdict(lambda :[-1]*(X+1))
for n in range(N):
    for x in range(X+1):
        if n == 0:
            dp[n][x]=x%S[0]
        else:
            dp[n][x]=(dp[n-1][x%S[n]]+n*dp[n-1][x])%mod

print(dp[N-1][X])
### BUGGY CODE ###

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

ans = 0
M = 10**9+7
for i in range(60):
    x = 0
    for j in range(N):     
        if A[j]>>i & 1:
            x += 1
    now = x * (N - x) % M
    for j in range(i):
        now = now * 2 % M
    ans += now
    ans %= M
print(ans)


### FIXED CODE ###

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

ans = 0
M = 10**9+7
for i in range(60):
    x = 0
    for j in range(N):     
        if A[j]>>i & 1:
            x += 1
    now = x * (N - x) % M
    for j in range(i):
        now = now * 2 % M
    ans += now
    ans %= M
print(ans)
### BUGGY CODE ###

a,b = map(float, input().split())

multi = a*b
i=1
test = 1

if (0<=multi) and (multi<1):
    test = 0

while True:
    if test == 0:
        i=0
        break
    elif (i<=multi) and (multi<i+1):
        break
    else:
        i = i*10
while True:
    if i ==0:
        break
    if (i<=multi) and (multi<i+1):
        break
        i=i+1

print(i)

### FIXED CODE ###

from decimal import Decimal

a,b = input().split()
b = b.replace(".","")
c = int(a)*int(b)//100

print(c)