import sys, math
from sys import stdin, stdout

rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())

def help(n,k,check):
    a=0
    b=0
    cnt=0
    #print n,k,check
    while(n>0):
        cnt+=11
        a+=min(k,n)
        n-=min(k,n)
        b+=n/10
        n=n-n/10

    return a,b

#help(3000,100,1500)

n=input()

left=1
right=n
if n%2==0:
    check=n/2
else:
    check=n/2+1

while(left<=right):
    k=(left+right)/2

    num,s=help(n,k,check)
    if num==check:
        print k
        exit()
    if left==right:
        print k
        exit()

    if num>=check:
        right=k
    else:
        left=k+1

print k

n = int(input())

lo, hi = 1, n+1
req = (n + 1) // 2

while lo < hi:

    mid = (lo + hi) // 2

    eaten = 0
    candies = n
    while candies > 0:
        val = min(candies, mid)
        eaten += val

        candies -= val
        candies -= candies // 10

    if eaten >= req:
        hi = mid
    else:
        lo = mid + 1

print (lo)

def foo(n,k):
	ans=0
	while(n):
		ans+=min(n,k)
		n-=min(n,k)
		n-=n//10
	return ans
n=int(input())
l=1
h=n
while(l<=h):
	m=(l+h)//2
	val=foo(n,m)
	if(2*val>=n):
		h=m-1
	else:
		l=m+1
print(h+1)

def simulate(n, k):
    m = n
    cnt = 0
    while m > 0:
        m -= k
        cnt += k
        if m >= 0:
             m -= m // 10
    return cnt + m

def descent(n, k):
    # print((n, k))
    s = simulate(n, k)
    while s * 2 >= n:
        k -= 1
        if (k == 0):
            break
        s = simulate(n, k)
    return k + 1

def binsearch(n, l, h):
    if h == l + 1:
        return descent(n, h)
    m = (l + h) // 2
    s = simulate(n, m)
    if s * 2 > n:
        return binsearch(n, l, m)
    else:
        return binsearch(n, m, h)

def start(n):
    return binsearch(n, 0, n)

# print(simulate(999999999999999973,39259424579862572),simulate(999999999999999973,39259424579862571))

print(start(int(input())))

n = int(input())
l = 1
r = n
res = n

def ok(k):
	m = n
	s = 0
	while (m > 0):
		if (m <= k):
			s += m
			m = 0
		else:
			s += k
			m -=k
		m -= m//10
	return 2 * s >= n

while (l <= r):
	mid = (l + r) // 2
	if (ok(mid)):
		res = mid
		r = mid - 1
	else:
		l = mid + 1
print(res)

n = int(input())

if n <= 10:
	print("1")
	exit()

def check(k):
	out = 0
	cur = n
	while cur != 0:
		tmp = min(cur, k)
		cur -= tmp
		out += tmp
		if cur >= 10:
			cur -= cur // 10
	return out

l = 0
r = 10 ** 18 + 1
k = (l + r) // 2
while r - l > 1:
	if 2 * check(k) >= n:
		r = k
	else:
		l = k
	k = (l + r) // 2

print(k + 1)

def func(n, k):
    v = 0
    p = 0
    while n > 0:
        v += min(k, n)
        n = max(n - k, 0) # Vasya
        p += n // 10
        n -= n // 10 # Petya
    return v >= p

n = int(input())
lo = 1
hi = n
while lo <= hi:
    mid = (lo + hi) // 2
    if func(n, mid):
        hi = mid - 1
    else:
        lo = mid + 1
print(lo)

n = int(input())
def cout(x):
    r,res=n,0
    while r>0:
        res+=min(r,x)
        r-=min(r,x)
        r-=r//10
    return res,n-res
i,j = 0,n
while i+1<j:
    mid = (i+j)//2
    a,b=cout(mid)
    if a<b:i=mid
    else:j=mid
print(j)

def p(n,k) :
    k1=0
    k2=0
    while (n>0):
        k1+=min(n,k)
        n-=min(n,k)
        k2+=n//10
        n-=n//10
    if k1>=k2 :
        return True
    else :
        return False

n=int(input())
p1=1
ost=n
while (p1<=ost) :
    mid=(p1+ost)//2
    if p(n,mid):
        ost=mid-1
    else :
        p1=mid+1
print(p1)

from math import ceil, sqrt
n = int(input())
if n < 20:
    print(1)
else:
    l = 1
    r = n
    s = 0
    t = n
    ans = n
    while l <= r:
        s = 0
        mid = (r+l)//2
        t = n
        while t > 0:
            c = min(mid, t)
            s += c
            t -= c
            t -= (t//10)
        if 2*s < n:
            l = mid+1
        elif 2*s >= n:
            r = mid - 1
            ans = mid
    print(ans)

n = int(input())
l = 0
r = n // 2 + 2
while r - l > 1:
    m = (l + r) // 2
    vasya = 0
    petya = 0
    x = n
    while x:
        if x >= m:
            vasya += m
            x -= m
            petya += x // 10
            x -= x // 10
        else:
            vasya += x
            x = 0
    if vasya >= (n + 1) // 2:
        r = m
    else:
        l = m
print(l + 1)

def main():
    n = hi = int(input())
    lo = 1
    while lo  < hi:
        mid, x, c = (lo + hi) // 2, n, 0
        while x > mid:
            x -= mid
            c += 1
            x -= x // 10
        if (c * mid + x) * 2 < n:
            lo = mid+1
        else:
            hi = mid
    print(hi)

if __name__ == '__main__':
    main()

def check(a,b):
    count=0
    while b>0:
        q =min(b,a)
        b-=q
        b-=(b//10)
        count+=q
    if 2*count >= n:
        return True
    else:
        return False
n = int(input())
l=1;ans=0;r=1000000000000000000000000
while l<=r:
    mid=(l+r)//2
    if check(mid,n):
        ans=mid
        r=mid-1
    else:
        l=mid+1
print(ans)

n = int(input())
def check(k,n):
  cur = n
  s = 0
  while cur > 0:
    o = min(cur, k)
    s += o
    cur -= o
    cur -= (cur // 10)
  return s*2 >= n
l = 1
r = n
ans = r
while l <= r:
  k = (l+r)//2
  if check(k, n):
    ans = k
    r = k-1
  else:
    l = k+1
print(ans)

#      Codeforces Round #491 (Div. 2)
import collections
from functools import cmp_to_key
#key=cmp_to_key(lambda x,y: 1 if x not in y else -1 )
import math
import sys
def getIntList():
    return list(map(int, input().split()))

import bisect
try :
    import numpy
    dprint = print
    dprint('debug mode')
except ModuleNotFoundError:
    def dprint(*args, **kwargs):
        pass
def makePair(z):
    return  [(z[i], z[i+1]) for i in range(0,len(z),2) ]

n, = getIntList()

def work(k,n):
    a = 0
    b = 0
    while(n>0):
        a += min(n,k)
        if n<=k:
            break
        n-=k
        t =  n//10
        b +=t
        n-=t
    if a>=b:
        return True
    return False

r0 = 0
r1 = n

while r0+1<r1 :
    m = (r0+r1)//2
    if work(m,n):
        r1 = m
    else :
        r0 = m

print(r1)

N = int(input())
c = N + 0
dai = N
syou = 0
if N % 2 == 0:
    hann = N//2
else:
    hann = N//2 + 1
while N:
    if c == 0:
      c = 1
      break
    d = N +0
    tasu = 0
    while N > 0:
      if d <= c:
         tasu += d
         break
      d  -= c
      tasu += c
      e = d//10
      d -=  e
    if tasu>= hann:
        dai = min(dai,c)
        if dai - syou == 1:
           break
        c = (dai+syou)//2

    else:
      syou = max(syou,c)
      if (syou+dai)//2 == syou:
         c = dai
         break
      c = (dai+syou)//2
print(c)

n = int(input())
l = 1
r = n
def can(x):
    v = 0
    p = 0
    n1 = n
    while n1 > 0:
        v += min(x, n1)
        n1 -= min(x, n1)
        p += n1 // 10
        n1 -= n1 // 10
    if v >= p: return 1
    else: return 0
while l < r:
    m = (l + r) // 2
    if can(m): r = m
    else: l = m + 1
print(r)

n = int(input())
def check(n,k):
    total = 0
    current = int(n)
    while current>0:
        red = min(current,k)
        current -= red
        total += red
        current -= current // 10

    return 2*total >= n

lower = 1
upper = n
ans = None
while lower<=upper:
    c = (lower+upper)//2
    ret = check(n,c)
    if ret:
        upper = c-1
        ans = c
    else:
        lower = c+1
print (ans)

n = int(input())
#binary search k - the larger k we choose the more likely we get at least half
lo,hi = 1,n #obviously we could set k := n to eat the whole box
def solve(n,k): #simulate the eating process (quite fast as n := 0.9(n-k))
    ans = 0
    while n > 0:
        ans += min(n,k)
        n -= min(n,k)
        n -= n//10
    return ans
while lo < hi:
    mid = (lo+hi)//2 #note no +1, as there is no (mid-1) below
    if solve(n,mid)*2 >= n:
        hi = mid
    else:
        lo = mid+1
print(lo)

def read_input():
	return map(int, input().split())

n = int(input())

def eat(k, n):
	ans = 0
	while n >= k:
		ans += k
		n = max(0, (n - k) - (n - k) // 10)
	ans += n
	return ans

l = 1
r = n + 1

while r - l > 1:
	m = (l + r) >> 1
	if 2 * eat(m, n) >= n:
		r = m
	else:
		l = m

print(l if 2 * eat(l, n) >= n else l + 1)

n = int(input())

end = n
start = 0
mid = n // 2

if n == 1:
    print(1)
else:
    while start < end:
        v = 0
        p = 0
        c = n
        while c > 0:
            if c <= mid:
                v += c
                c = 0
            else:
                c -= mid
                v += mid

            p += c // 10
            c -= c // 10

        if v >= p:
            end = mid - 1
        else:
            start = mid + 1
        mid = (end + start) // 2
        if mid == 0:
            mid = 1
    v = 0
    p = 0
    c = n
    while c > 0:
        if c <= mid:
            v += c
            c = 0
        else:
            c -= mid
            v += mid

        p += c // 10
        c -= c // 10

    if v >= p:
        print(mid)
    else:
        print(mid + 1)

import math

def f(n, k):
    ans = 0
    s = 0
    while n > 0:
        s += 1
        if n >= k:
            ans += k
            n -= k
        else:
            ans += n
            n = 0
        if n > 0:
            n = n - n // 10
    return ans

n = input()
l, r = 1, n

while l < r:
    m = (l+r) // 2
    p = f(n, m)
    #print l, r, m, p
    if (p*2 >= n):
        r = m
    else:
        l = m + 1
print r

import sys
n = int(input())
def eat(k):
    c = n
    count = 0
    while c > 0:
        d = max(c - k, 0)
        count += c - d
        c = d
        if c > 0:
            c -= c // 10
    if count >= (n + 1) // 2:
        return True
    else:
        return False
if eat(1):
    print(1)
    sys.exit()
def binpoisk():
    r = n
    l = 1
    while r - l > 1:
        middle = (r + l) // 2
        if eat(middle):
            r = middle
        else:
            l = middle
    return r
print(binpoisk())

n=int(raw_input())

if n<=40 or n==42:
    print 1
    exit()

def ct(n,k):
    s=n
    a=0
    b=0
    while s>0:
        a+=min(k,s)
        s-=min(k,s)
        b+=s/10
        s-=s/10
    if 2*a>=n:
        return True
    else:
        return False

def ccc(n):
    st=1
    ed=n/2
    mid=(st+ed)/2
    while ed-st>3:
        mid=(st+ed)/2
        #print st,ed, mid
        if ct(n,mid):
            ed=mid
        else:
            st=mid
    for i in range(st,ed+1):
        if ct(n,i):
            return i

print ccc(n)
exit()

import sys
import math
import collections
from pprint import pprint as pp
mod = 998244353
MAX = 10**10

def inp():
    return map(int, input().split())

def array():
    return list(map(int, input().split()))

def vector(size, val=0):
    vec = [val for i in range(size)]
    return vec

def matrix(rowNum, colNum, val=0):
    mat = []
    for i in range(rowNum):
        collumn = [val for j in range(colNum)]
        mat.append(collumn)
    return mat

n = int(input())
l, h, ans = 1, n, 0

def fun(k):
    can = n
    temp = 0
    while can > 0:
        temp += min(k, can)
        can -= min(k, can)
        can -= can // 10
    return 2 * temp >= n

while l <= h:
    m = (l + h) // 2
    if fun(m):
        ans, h = m, m - 1
    else:
        l = m + 1
print(ans)

n = int(input())
a = 0
b = n
while b - a != 1:
    k = (a + b) // 2
    c = n
    d = 0
    while c > 0:
        m = min(k, c)
        c -= m
        c -= c // 10
        d += m
    if 2 * d >= n:
        b = k
    else:
        a = k
print(b)

def check(n, k):

    total, curr = 0, n
    while curr > 0:
        take = min(curr, k)
        total += take
        curr -= take
        curr -= curr // 10

    return total * 2 >= n

def find_min_k(n):
    start, end, min_k  = 1, n, n

    while start <= end:
        middle = (start + end) // 2
        if check(n, middle):
            min_k = min(min_k, middle)
            end = middle - 1
        else:
            start = middle + 1

    return min_k

print(find_min_k(int(input())))

n=int(input())

l=1
r=n
while(l!=r):
    mid=(l+r)//2
    k=n
    t1=0
    while(k>0):
        t1+=min(mid,k)
        k-=min(mid,k)
        k-=k//10
    if(t1>=(n+1)//2):
        r=mid
    else:
        l=mid+1
print(l)

# -*- coding: utf-8 -*-
"""
Created on Thu Jul 05 21:08:58 2018

@author: harshkhemka
"""
def check(n,k):
    cur=n
    sum1=0
    while(cur>0):
        o=min(cur,k)
        sum1=sum1+o
        cur=cur-o
        cur=cur-long(cur/10)
    return (sum1*2)>=n

def process():
    n=long(raw_input())
    l=1
    u=n
    while(l<=u):
        k=long((l+u)/2)
        if check(n,k)==False:
            l=k+1
        else:
            prev=k
            u=k-1#0
    if k==0:
        print(1)
    elif prev==-1:
        print(k)
    else:
        print(prev)

process()

n = int(input())

l = 1
r = (n + 1) // 2
mid = 0

while l < r :
	t = n
	mid = (l + r) >> 1
	cnt = 0
	while t >= 10 :
		t = t - mid
		if t > 0 : t = t - t // 10
		cnt = cnt + 1
	amo = cnt * mid + t
	if amo * 2 >= n : r = mid
	else : l = mid + 1
print(l)

def solve(i,n):
    tmp = n
    eaten = 0
    while(tmp > 0):
        eaten += min(tmp,i)
        tmp -= min(tmp,i)
        if(tmp>=10):
            tmp = tmp - (tmp // 10)
    #print i,eaten,n,eaten*1.0/n * 100
    if(eaten >= (n+1)/2):
        return 1
    return 0
n = int(raw_input())
lo = 1
hi = n
while(lo<hi):
    mid = (lo + hi) / 2
    if(solve(mid,n)==1):
        hi = mid
    else:
        lo = mid+1
for i in range(max(1,lo-50),lo+100):
    if(solve(i,n)==1):
        print i
        break

#https://codeforces.com/contest/991
#Binary Search

n=int(input())

def petya(n, k):
    total = n
    s = 0

    while n > 0:
        cur = min(n, k)
        s += cur
        n -= cur

        n -= n // 10

    return s * 2 >= total

low=1
high=n
candies=n
aim=candies/2
mid=1
ans=1

while low<=high:
	mid=(low+high)//2
	if(petya(candies,mid)):
		ans=mid
		high=mid-1

	else:
		low=mid+1

print(ans)

import math
# t = int(input())
t = 1

def check(k, totalCandies, ate=0):
	base = totalCandies
	while 2*ate < base and totalCandies > 0:
		ateNow = min(k, totalCandies)
		ate += ateNow
		totalCandies -= ateNow
		totalCandies -= (totalCandies//10)
	# print(ate, totalCandies)
	return 2*ate >= base

# print(check(3, 68))s

for _ in range(t):
	candies = int(input())
	l, r, store  = 1, candies, math.ceil(candies/2)

	while l <= r:
	 	mid = (l+r)//2
	 	ateHalf = check(mid, candies)
	 	# print(l, mid, r, "at mid", ateHalf)
	 	if ateHalf is True:
	 		store = mid
	 		r = mid - 1
	 	else:
	 		l = mid + 1

	print(store)

n = int(input())

l, r = 0, 10 ** 18

def enough(n, k):
    was = n
    eaten = 0
    while n > 0:
        eaten += min(n, k)
        n -= k
        if n > 0:
            n -= n // 10
    return 2 * eaten >= was

while l + 1 < r:
    m = (l + r) // 2
    if not enough(n, m):
        l = m
    else:
        r = m
print(r)

def f(n, k):
    n0, s = n, 0
    while n > 0:
        s += min(n, k)
        n -= min(n, k)
        n -= n // 10
    return s * 2 >= n0

def g(n):
    lo, hi = 1, n
    while lo < hi:
        mid = (lo + hi) // 2
        if f(n, mid):
            hi = mid
        else:
            lo = mid + 1
    return lo

print(g(int(input())))

n=input()
l,h=1,n
while l<h:
    m=(l+h)/2
    a,b,c=0,0,n
    while c:
        d=min(c,m)
        a+=d
        c-=d
        b+=c/10
        c-=c/10
    if a<b:
        l=m+1
    else:
        h=m
print l

def f(tmpn, k):
	vasya = 0
	aa = tmpn
	while tmpn > 0:
		t = min(k, tmpn)
		tmpn -= t
		tmpn -= tmpn/10
		vasya += t
	if 2*vasya >= aa:
		return True
	return False

n = input()
low = 1
high = n

while low < high:
	mid = (low + high)/2
	if f(n, mid):
		high = mid
	else:
		low = mid + 1
print low

n = input()
wyn = 0
if n == 1:
    print '1'
    exit(0)
def sim(amount,v):
    a=b=0
    while True:
        if amount-v >= 0:
            amount -= v
            a += v
            b += amount/10
            amount -= amount/10
        else:
            a += amount
            break
    if a>=b:
        return True
    else:
        return False
l=1
r=n
while l<r:
    m = (r+l)/2
    aa = sim(n,m)
    if aa == True:
        wyn = m
        r = m
    else:
        l = m+1
print wyn

from math import ceil
def sol(n,k,c):
    if k==0:
        return -1
    if n<=0:
        return c
    else:
        n1=n
        n=n-k-((n-k)//10)
        return sol(n,k,min(c+k,c+n1))

n=int(input())
low=1
high=n
lim=n//2
if n%2!=0:
    lim+=1
while high-low>1:
    md=(high+low)//2
    x=sol(n,md,0)
    if x>lim:
        high=md
    else:
        low=md
x=min(high+1000,n)
while sol(n,x,0)>=lim:
    x-=1
print(x+1)

from math import ceil
def sol(n,k,c):
    if n<=0:
        return c
    else:
        n1=n
        n=n-k-((n-k)//10)
        return sol(n,k,min(c+k,c+n1))

n=int(input())
low=1
high=n
lim=n//2
if n%2!=0:
    lim+=1
while high-low>1:
    md=(high+low)//2
    x=sol(n,md,0)
    if x>lim:
        high=md
    else:
        low=md
if sol(n,low,0)>=lim:
    print(low)
else:
    print(high)

n=int(input())
def query(k):
    t=n
    g=(n+1)//2
    while t:
        if t<k:
            g-=t
            break
        t-=k
        g-=k
        t=t-t//10
    if g<=0:return 1
    else:return 0

def bs(l,r):
    if l==r: return l
    m=(l+r)//2
    if query(m):return bs(l,m)
    else: return bs(m+1,r)

print(bs(1,1000000000000000000))

def fun(m,n):
    c=n
    cnt=0
    while(c>0):
        cnt+=min(m,c)
        c-=min(m,c)
        c-=c/10
    if cnt>=(n+1)/2:
        return 1
    else:
        return 0

n=input()
l,h=1,n
while(l<h):
    md=l+(h-l)/2
    if fun(md,n):
        h=md
    else:
        l=md+1
print h

n=int(input())
def f(k):
 s=m=n
 while s>0and m:
  l=min(k,m);s-=2*l;m-=l;m-=m//10
 return s<=0
l=[0,n]
while l[1]-l[0]>1:
 m=sum(l)//2;l[f(m)]=m
print(l[1])

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations

sys.setrecursionlimit(10000)

def read_int():
    return int(input())

def read_int_n():
    return list(map(int, input().split()))

def read_float():
    return float(input())

def read_float_n():
    return list(map(float, input().split()))

def read_str():
    return input()

def read_str_n():
    return list(map(str, input().split()))

def error_print(*args):
    print(*args, file=sys.stderr)

def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap

def sim(n, k):
    ans = 0
    while n > 0:
        if n >= k:
            ans += k
            n -= k
        else:
            ans += n
            n = 0

        n -=  n //10

    return ans

def slv2(N):
    for k in range(1, N):
        if sim(N, k) >= N/2:
            return k
    return 1

@mt
def slv(N):
    if N < 1000:
        return slv2(N)

    sk = int(N*0.03)
    ek = int(N*0.1)
    cnd = {}
    while True:
        if ek - sk <= 1:
            break
        ck = (sk + ek)//2
        v = sim(N, ck)
        cnd[ck] = v
        if v <= N/2:
            sk = ck
        else:
            ek = ck

    H = N//2
    if H*2 == N:
        H -= 1

    keys = sorted(cnd.keys())
    for i, k in enumerate(keys):
        if cnd[k] > H:
            error_print(keys[i-1], keys[i])
            for j in range(keys[i-1], keys[i]):
                cnd[j] = sim(N, j)
            break
    keys = sorted(cnd.keys())
    for i, k in enumerate(keys):
        if cnd[k] > H:
            return k

def main():
    N = read_int()
    # N = 999999999999999973
    # N = int(1e+18)
    # N = random.randint(int(1e+18)-10000, int(1e+18))
    print(slv(N))

    # for n in range(1000000, 1000000+10):
    #     print(n)
    #     a = slv(n)
    #     b = slv2(n)
    #     if a != b:
    #         print(n, a, b)
    #         break

if __name__ == '__main__':
    main()

n = int(raw_input())
def p(n,k):
	sum  = 0
	a = n
	while(n > 0):
		c = min(k,n)
		n = n - c
		n = n - n/10
		sum = sum + c
	if 2*sum >= a:
		return True
	else:
		return False

hi = n/10
lo = 1
while lo < hi:
	mid = lo + (hi-lo)/2
	if p(n,mid) == True:
		hi = mid
	else:
		lo = mid+1
print lo

#import resource
#import sys
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#sys.setrecursionlimit(0x10000000)
"""FLOAT FUCKED ME TWICE THIS TIME
   PRECISION IS A BITCH
   FUCK CF"""
from sys import stdin, stdout
def GCD(x, y):
   while(y):
       x, y = y, x % y
   return x
def BS(arr, l, r, x):
    if r >= l:
        mid = l + (r - l)/2
        if arr[mid] == x:
            return mid
        elif arr[mid] > x:
            return BS(arr, l, mid-1, x)
        else:
            return BS(arr, mid+1, r, x)
    else:
        return -1
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import math
import Queue
a=input()
h=a
l=1
k=a
w=a/2
if(a%2==1):
    w+=1
while(h>=l):
    m=(h+l)/2
    r=0
    e=a
    while(e>0):
        r+=min(m,e)
        e-=min(m,e)
        if(e>9):
            q=e/10
            e-=q
    if(r>=w):
        h=m-1
        k=m
    else:
        l=m+1
print k

n = int(input())
l = 1
r = n
ans = 0
while l <= r:
    count = 0
    k = (l + r) // 2
    now = n
    while now > 0:
        if now - k < 0:
            count += now
            now = 0
        else:
            count += k
            now -= k
            now -= now//10
    if count*2 >= n:
        ans = k
        r = k - 1
    else:
        l = k + 1
print(ans)

def fun(n,k):
    s1=0
    s2=n
    while s2>0:
        temp = min(k,s2)
        s2-=temp
        s1+=temp
        s2-=s2/10
    if s1*2>=n:
        return True
    return False

n=input()
k=1
while True:
    if fun(n,k):
        break
    else:
        k*=2
k=k/2

if k!=0:
    low=k
    high = 2*k+1
    while low<=high:
        mid=(low+high)/2
        if fun(n,mid):
            high=mid-1
        else:
            low=mid+1
    print low
else:
    print 1

DEBUG = True
n = input().strip().split(" ")
n = int(n[0])

def oneTest(N, k):
    n = N

    nv = 0
    np = 0

    while n > 0:
        if n <= k:
            nv += n
            n = 0
        else:
            n -= k
            nv += k

            x = n // 10
            n -= x
            np += x

    assert nv + np == N
    return nv * 2 >= N

def getResult(n):
    lo = 1
    hi = n
    while lo < hi:
        mid = (lo + hi) // 2
        if not oneTest(n, mid):
            lo = mid + 1
        else:
            hi = mid
    return lo

k = getResult(n)
print(k)

if DEBUG:
    if k > 1:
        assert not oneTest(n, k-1)
    assert oneTest(n, k)
    assert oneTest(n, k+1)

def check(n,k):
    req = (n//2) + (n%2)
    eat = 0
    while n > 0 and eat < req:
        eat += min(n,k)
        n -= min(n,k)
        n -= n//10
    if eat >= req:
        return True
    else:
        return False

n = int(input())
l = 1
r = n
ans = 0
# l <= r, equal will be there, since you are alloting m-1 and m+1
while l <= r:
    m = (l+r)//2
    if check(n,m):
        r = m-1
    else:
        l = m+1

print(l)

import math as mt

def ans(n, k):
    sm = 0
    while n - k - (n - k) // 10 > 0:
        n = n - k - (n - k) // 10
        sm += k
    sm += n
    return sm

n = int(input())
l = 1
s = 0
r = n
if n%2==0:
    b = n//2
else:
    b = n//2 +1
while l <= r:
    mid = (l + r) // 2
    t = ans(n, mid)
    if t == b:
        s = mid
        break
    elif t < b:
        l = mid + 1
    else:
        s = mid
        r = mid - 1
print(s)

n = int(input())

half = (n-1) // 2 + 1

def simulate(k):
    remain = n
    vasya = 0

    while remain > 0:
        vasya += min(k, remain)
        remain -= k
        remain -= remain // 10

    return vasya >= half

hi = n
lo = 0

while hi - lo > 1:
    mid = (hi + lo) // 2

    if simulate(mid):
        hi = mid
    else:
        lo = mid

print(hi)

n = int(input())

def valid(m):
    res = 0
    k = n
    while k > 0:
        res += min(k, m)
        k -= min(k, m)
        k -= k // 10
    return res >= n - res

def binary_search():
    f, e = 1, int(1<<62)
    while f <= e:
        m = f + e >> 1
        if valid(m):
            e = m - 1
        else:
            f = m + 1
    return f

print(binary_search())

n = int(input())

lo = 1
hi = n

def func(k, n):
    ans = 0
    while n != 0:
        ans += min(n, k)
        n -= min(n, k)
        n -= n // 10

    return ans

ans = 0
while lo <= hi:
    mid = (lo + hi) // 2

    a = func(mid, n)

    if 2*a >= (n):
        ans = mid
        hi = mid - 1
    else:
        lo = mid + 1

print(ans)

from sys import stdin
input=lambda : stdin.readline().strip()
from math import ceil,sqrt,factorial,gcd
from collections import deque
def check(n,k):
	a=0
	b=0
	while n>0:
		if k<=n:
			a+=k
			n-=k
		else:
			a+=n
			n=0
		if n>=10:
			b+=n//10
			n-=n//10
	if a>=b:
		return True
	return False

n=int(input())
l=1
r=n
while l<=r:
	mid=(l+r)//2
	# print(mid,l,r)
	if check(n,mid):
		r=mid-1
	else:
		l=mid+1
print(l)

import time
n = int(input())

def check(k):
    m = n
    t = 0
    while m >= k:
        m -= k
        t += k
        d = m//10
        m -= d
    t += m
    return 2*t >= n

low = 1
high = n

while low < high:
    mid = low + (high - low) // 2
    if check(mid):
        high = mid
    else:
        low = mid + 1

print(low)

"""
#If FastIO not needed, used this and don't forget to strip
#import sys, math
#input = sys.stdin.readline
"""
import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right

from types import GeneratorType
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        import os
        self.os = os
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            self.os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

import collections as col

def getInts():
    return [int(s) for s in input().split()]

def getInt():
    return int(input())

def getStrs():
    return [s for s in input().split()]

def getStr():
    return input()

def listStr():
    return list(input())

MOD = 10**9+7

"""
while N:
    x = min(K,N)
    N -= x
    V += x
    x = N//10
    N -= x
    P += x
"""
def works(K,n):
    P = V = 0
    while n:
        x = min(K,n)
        n -= x
        V += x
        x = n//10
        n -= x
        P += x
    return V >= P

def solve():
    N = getInt()
    if works(1,N):
        return 1
    assert(works(N,N))
    right = N
    left = 1
    while right - left > 1:
        middle = (right+left)//2
        if works(middle,N):
            right = middle
        else:
            left = middle
    return right

#for _ in range(getInt()):
print(solve())

n=int(input())
def w(k):
    s=n
    p=0
    while s>0:
        p+=min(s,k)
        s=max(0,s-k)
        s-=s//10
    if 2*p>=n:
        return True
    return False

l,r=1,n
while l<r:
    m=(l+r)//2
    if w(m):
        r=m
    else:
        l=m+1
print(r)

n = int(input())
def check(k, n):
  s = 0
  cur = n
  while cur > 0:
    t = min(cur, k)
    s += t
    cur -= t
    cur -= cur // 10

  return s * 2 >= n
l = 1
r = n // 2
while l < r - 1:
  m = (l + r) // 2
  if not check(m, n):
    l = m + 1
  else:
    r = m
if l == 0:
  print(r)
else:
  if check(l,n):
    print(l)
  else:
    print(r)

import math

def f(n,choc):
    m,vas=n,0
    while m>0:
        u=min(choc,m)
        vas+=u
        m-=u
        m-=m//10
    return vas

n=int(input())

a=[]
low,high=1,10**18
while(low<=high):
    mid=low+(high-low)//2
    x=f(n,mid)
    if 2*x<n:
        low=mid+1
    else:
        a.append(mid)
        high=mid-1

print(min(a))

import math

def f(n,choc):
    vas,m=0,n
    while(1):
        if (n-choc)<0:
            vas+=n
            n=0
            break
        n-=choc
        vas+=(m-n)
        u=n//10
        if(n-u)<0:
            n=0
            break
        n-=u
        m=n
    return vas

n=int(input())

a=[]
low,high=1,10**18
while(low<=high):
    mid=low+(high-low)//2
    x=f(n,mid)
    if 2*x<n:
        low=mid+1
    else:
        a.append(mid)
        high=mid-1

print(min(a))

import sys
import bisect
# import heapq
from math import ceil,floor

def check(k,n):
    fr = 0
    temp=  n
    while ( n > 0):
        if n < k :
            fr = fr+n
            n = 0
        else:
            fr = fr + k
            n = n-k
            n -= (n//10)
    return fr*2>= temp

RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
mod = 10**9+7
# for _ in range(int(ri())):

n = int(ri())
l = 1
r = n
ans = r
while ( l <= r):
    mid = (l+r)//2
    if check(mid,n):
        r = mid-1
        ans = min(ans,mid)
    else:
        l = mid+1
print(ans)

def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

def f(n, k):
    c = 0
    e = 0
    while n > 0:
        e += min(k, n)
        n -= k
        n -= n // 10
        c += 1
    return e

n = ii()
lo = 1
hi = th = (n + 1) // 2
while lo < hi:
    mid = (lo + hi) // 2
    cnt = f(n, mid)
    if cnt >= th:
        hi = mid
    else:
        lo = mid + 1
print(lo)

n = int(input())

ans = 1

l = 0
r = n
while l<r:
    m = (l+r)//2
    a = n
    x = 0
    y = 0
    while a>9:
        x+=min(m,a)
        a-=min(m,a)
        if a>9:
            y+=a//10
            a-=a//10
    x+=a
    if x>=n//2+n%2:
        ans = m
        r = m
    else:
        l = m+1
print(max(ans,1))

# -*- coding: utf-8 -*-

def rli():
    return list(map(int, input().split()))

def eat(n, k):
    ans = 0
    while n:
        ans += min(n, k)
        n -= min(n, k)
        n -= n // 10
    return ans

def main():
    n = int(input())
    k = n
    now = 1 << 60
    need = n // 2 + (n % 2 != 0)
    while now:
        if k - now > 0 and eat(n, k - now) >= need:
            k -= now
        now >>= 1
    print(k)

if __name__ == '__main__':
    main()

n = int(input())

def check(k):
    num = n
    f, s = 0, 0
    while True:

            if num < k:
                f += num
                break
            else:
                f += k
                num -= k
            z = num // 10
            num -= z
            s += z

    return f >= s

l= 1
r  = n

while l <= r:
    if (l == r):
        mid = l
        break
    mid = (l + r) // 2
    if check(mid):
        r = mid
    else:
        l = mid + 1

print(mid)

n = int(input())

def can(x):
    v = 0
    t = n
    while t>0:
        if t<max(x,10) :
            v += t
            break
        v += x
        t -= x
        t -= t//10
    return (v >= ((n+1)//2))

lo = 1
hi = n
while lo<hi:
    mid = lo+((hi-lo)>>1);
    if can(mid):
        hi=mid
    else:
        lo=mid+1
print(lo)

R = lambda: map(int, input().split())
n = int(input())
l, r = 1, n
while l < r:
    m = (l + r) // 2
    nc, vc = n, 0
    while nc > 0:
        vc += min(m, nc)
        nc -= min(m, nc)
        nc -= nc // 10
    if vc * 2 >= n:
        r = m
    else:
        l = m + 1
print(l)

def check(n,a):
  e=0
  n1=n
  while n1>0:
    e+=min(n1,a)
    n1-=min(n1,a)
    n1-=n1//10

  if 2*e>=n:
    return True
  return False
n=int(input())
l=1
r=n
ans=2*(10**18)
while l<=r:
  mid=(l+r)//2
  if check(n,mid):
    ans=min(mid,ans)
    r=mid-1
  else:l=mid+1
print(ans)

def count(n,k):
    v,p = 0,0
    while True:
        v+=k
        n=n-k
        if n>=10:
            t=n//10
            p+=t
            n=n-t
        else:
            break
    v+=n
    if v>=p:
        return True
    else:
        return False
n = int(input())
if n<30:
    print(1)
else:
    low,high = 0,n//2
    while low<=high:
        mid = (low+high)//2
        p,q = count(n,mid),count(n,mid-1)
        if p==True and q==False:
            print(mid)
            break
        if p==True and q==True:
            high = mid-1
        if p==False and q==False:
            low = mid+1

def process(n, k):
    cnt = 0

    while n > 9:
        x = min(n, k)
        n -= x
        cnt += x
        n -= n // 10

    return cnt + n

if __name__ == '__main__':
    n = int(input())

    hi = n // 2
    lo = 1

    k = 1

    while hi > lo:
        mid = (hi + lo) // 2

        p1 = process(n, mid)
        p2 = process(n, mid - 1)

        b1 = p1 * 2 >= n
        b2 = p2 * 2 < n

        k = mid

        if p2 > p1:
            print(mid)

        if b1 and b2:
            break
        elif not b1:
            lo = mid
        else:
            hi = mid

    print(k)

from __future__ import print_function
import sys
import math
import os.path
import random
from copy import deepcopy
from functools import reduce
from collections import Counter, ChainMap, defaultdict
from itertools import cycle, chain
from queue import Queue, PriorityQueue
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, nlargest, nsmallest
import bisect
from statistics import mean, mode, median, median_low, median_high
# CONFIG
sys.setrecursionlimit(1000000000)
# LOG
def log(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
# INPUT
def ni():
    return map(int, input().split())
def nio(offset):
    return map(lambda x: int(x) + offset, input().split())
def nia():
    return list(map(int, input().split()))
# CONVERT
def toString(aList, sep=" "):
    return sep.join(str(x) for x in aList)
def toMapInvertIndex(aList):
    return {k: v for v, k in enumerate(aList)}
# SORT
def sortId(arr):
    return sorted(range(arr), key=lambda k: arr[k])
# MATH
def gcd(a,b):
    while b:
        a, b = b, a % b
    return a
# MAIN

n, = ni()

def check(k):
    v = 0
    p = 0
    x = n
    # log("check",k)
    while (x > 0):
        if (x > k):
            v += k
            x -= k
            if (x > 9):
                pd = x // 10
                p += pd
                x -= pd
        else:
            v += x
            x = 0

        # log(" ", x, v, p)

    # log(k,v,p)
    return v >= p

def bsearch(low, high):
    # log(low,high)
    if (low >= high):
        return low
    mid = (low + high) // 2
    if check(mid):
        return bsearch(low, mid)
    else:
        return bsearch(mid+1, high)

x = bsearch(1,n)
# log(x)
print(x)

import math

n = int(input())

def sim(n, k):
    v = 0
    while n > 0:
        a = min(n, k)
        n -= a
        v += a
        n -= (n//10)

    return v

l = 1
r = n

while r-l >= 0:
    mid = (r+l)//2

    if sim(n, mid) == math.ceil(n/2):
        break

    if sim(n, mid) > math.ceil(n/2):
        r = mid-1
    if sim(n, mid) < math.ceil(n/2):
        l = mid+1

print(mid)

#!/usr/bin/python

from collections import deque

def ir(): return int(raw_input())
def ia(): return map(int, raw_input().split())

def good(k):
    n = N
    vasya = 0
    while True:
        if n <= k:
            vasya += n
            break
        else:
            n -= k
            vasya += k
        n -= n/10
    return 2 * vasya >= N

# not good(l)   good(h)
N = ir()
l = 1; h = N
while True:
    if h == l + 1 or h == l: break
    m = (l + h)/2
    if good(m): h = m
    else:       l = m

print h

def fun(m,n):
    c=n
    cnt=0
    while(c>0):
        cnt+=min(m,c)
        c-=min(m,c)
        c-=c/10
    if cnt>=n/2:
        return 1
    else:
        return 0

n=input()
l,h=1,n
while(l<h):
    md=(l+h)/2
    if fun(md,n):
        h=md-1
    else:
        l=md+1
print l

"""
http://codeforces.com/problemset/problem/991/C
NNNNNNNYYYYYY Problem
"""
import math
def solveBinarySearch(n):

	lo = 1
	hi = n
	# import pdb; pdb.set_trace()
	while (lo < hi):

		mid = (lo + hi) / 2
		candies_eaten = computeNumCandies(mid, n)
		if (candies_eaten):
		# if (helper(n, mid)):
			hi = mid

		else :
			lo = mid + 1
	return lo

def computeNumCandies(mid, n):
	num_candies = n
	candies_eaten = 0
	pet_eaten = 0
	# import pdb; pdb.set_trace()
	while (num_candies > 0):
		# Vasya eats them all
		if (num_candies < mid):
			candies_eaten += num_candies
			# num_candies = 0
			# return candies_eaten
		else: #Vasya takes mid candies
			# num_candies = num_candies - mid
			candies_eaten += mid
		num_candies = num_candies - mid

		#Petya rounds down the remaining candy
		petya_eats = num_candies / 10
		num_candies = num_candies - petya_eats
		pet_eaten = pet_eaten + petya_eats

	return candies_eaten >= pet_eaten

n = int(input())
print(solveBinarySearch(n))

n = input().strip().split(" ")
n = int(n[0])

def oneTest(N, k):
    n = N

    nv = 0
    np = 0

    while n > 0:
        if n <= k:
            nv += n
            n = 0
        else:
            n -= k
            nv += k

            x = n // 10
            n -= x
            np += x

    return nv / N >= 0.5

def getResult(n):
    lo = 1
    hi = n
    while lo < hi:
        mid = (lo + hi) // 2
        if not oneTest(n, mid):
            lo = mid + 1
        else:
            hi = mid
    return lo

k = getResult(n)
print(k)
if k <= 1:
    print(False)
else:
    print(oneTest(n, k-1))
print(oneTest(n, k))
print(oneTest(n, k+1))

#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]

#-------------------------code---------------------------#
#vsInput()

def canEat(k):
    rem=n
    eaten=0
    while(rem>0):
        eat=min(k,rem)
        rem-=eat
        rem-=rem//10
        eaten+=eat

    return eaten >= n//2

n=Int()

low=1
high=n

while(low<=high):

    mid=(low+high)//2

    if(canEat(mid)):
        ans=mid
        high=mid-1
    else:
        low=mid+1

print(ans)

n = int(input())

for i in range(1, n):
    v = 0
    p = 0
    start = n
    while start > 0:
        if start <= i:
            v += start
            start = 0
        else:
            start -= i
            v += i

        p += int(start / 10)
        start -= int(start / 10)
    if v >= n / 2:
        print(i, v, p)
        break

def find_n(k):
    ev = n
    od = ev - k
    ev = od - od // 10
    c = 0
    while 1:
        c += 1
        od = ev - k # u_{2n + 1}
        # print(od, end=" ")
        if od < 0: return (c - 1 + 1) * k + ev
        ev = od - od // 10 # u_{2n + 2}
        # print(ev)

n = int(input())
#print(n)

a = 1
b = n // 2 + 1

while a <= b:
    k = (a + b) // 2
    if find_n(k) > n / 2:
        last = b
        b = k - 1
    elif find_n(k) < n / 2:
        a = k + 1
    else:
        break

print(k if find_n(k) >= n / 2 else last)

def candy_man(n,k):
    sum=0
    curr=n
    while curr>0:
        m=min(k,curr)
        sum+=m
        curr-=m
        curr-=curr//10
    if sum*2>=n:
        return True
    else:
        return False

def k_maker(n):
    high=n
    low=1
    mid=(high+low)//2
    while low!=high:
        if candy_man(n,mid):
            high=mid
            mid=(low+high)//2
        else:
            low=mid+1
            mid=(high+low)//2
    print(low)
# n=int(input())
k_maker(1)

def cas(mid,n):
	calc1 = 0
	calc2 = 0
	s = n
	while(calc2 < n/2 and calc1 < n/2 and s > 0):
		s -= min(mid,s)
		calc1 += min(mid,s)
		s -= int(s/10)
		calc2 += int(s/10)
	# 	print(calc1)
	# 	print(calc2)
	# print(calc1)
	# print(calc2)
	if(calc1 >= n/2):
		return 1
	else:

		return -1

def binS(begin,end,n):
	mid = int((begin+end)/2)
	p = cas(mid,n)
	q = cas(mid+1,n)
	if(p == -1 and q == 1):
		return mid + 1
	elif(p == -1 and q == -1):
		return binS(mid+1,end,n)
	elif(p == 1 and q == 1):
		return binS(begin,mid-1,n)
	else:
		return -1

n = int(input())
if(n<22):
	print(1)
else:
	print(binS(0,int(n/2),n))

n = int(raw_input())
def p(n,k):
	sum  = 0
	a = n
	while(n > 0):
		n = n - k
		n = n - n/10
		sum = sum + k
	sum = sum + n
	if 2*sum >= a:
		return True
	else:
		return False

hi = n/10
lo = 1
while lo < hi:
	mid = lo + (hi-lo)/2
	if p(n,mid) == True:
		hi = mid
	else:
		lo = mid+1
print lo

def count(n,k):
    v,p = 0,0
    while n>=10:
        v+=k
        n=n-k
        t=n//10
        p+=t
        n=n-t
    v+=n
    if v>=p:
        return True
    else:
        return False
n = int(input())
if n<30:
    print(1)
else:
    low,high = 0,n//2
    while low<=high:
        mid = (low+high)//2
        p,q = count(n,mid),count(n,mid-1)
        if p==True and q==False:
            print(mid)
            break
        if p==True and q==True:
            high = mid-1
        if p==False and q==False:
            low = mid+1

# @oj: codeforces
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-04-28 15:31
# @url:https://codeforces.com/problemset/problem/991/C
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
# region fastio

BUFSIZE = 8192

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# ------------------------------
def main():
    n=int(input())
    l,r=1,math.ceil(n/2)
    def check(m,n):
        v,p=0,0
        temp=n
        while n>0:
            v+=min(m,n)
            n-=m
            if n>=10:
                p+=(n//10)
            n-=(n//10)
        print (v,p)
        return v>=temp//2
    while l<r:
        mid=(l+r)//2
        if check(mid,n):
            r=mid
        else:
            l=mid+1
    print (l)
if __name__ == "__main__":
    main()

#https://codeforces.com/contest/991
#Binary Search

n=int(input())

def petya(n, k):
    total = n
    s = 0

    while n > 0:
        cur = min(n, k)
        s += cur
        n -= cur

        n -= n // 10

    return s * 2 >= total

low=1
high=n
candies=n
aim=candies/2
mid=1
ans=1

while low<=high:
	mid=(low+high)//2
	if(petya(candies,mid)):
		ans=mid
		high=mid-1

	else:
		low=mid+1

print(ans)
print(petya(999999999999999973,39259424579862569))

import math
getInputList = lambda : list(input().split())
getInputIntList = lambda : list(map(int,input().split()))

n = int(input())

h = n//2
left = 1
right = n

def eat(k,n):
	a = 0
	while n > 0:
		#print(a,n,k)
		a += min(k,n)
		n -=  min(k,n)
		n -=  (n*10)//100
	return a

ans = eat(39259424579862572,n)
if n != 1:
	while left <= right:
		m = (left + right)//2
		eat1 = eat(m,n)
		eat2 = 0
		if m-1 > 0:
			eat2 = eat(m-1,n)

		if eat1 >= h and eat2 < h:
			print(eat1,eat2,h)
			print(m)
			break
		if eat1 < h:
			left = m
		else:
			right = m

else:
	print(1)

def sum_for_k(n,k,a):
	c=0
	while(a[c]>=10):
		a.append(int((0.90 *(a[c]))-k))
		c=c+1
	return 0.10 * sum(a)

def process():
    n=int(raw_input())
    l=0
    u=n
    a=list()
    while(l<=u):
        k=int((l+u)/2)
        a.append(n-k)
        petaya=int(sum_for_k(n,k,a))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            u=k-1#0
    if n%2!=0 or l==0:
        print(l+1)
    else:
        print(l)

process()

def sum_for_k(n,k,a):
	c=0
	while(a[c]>=10):
		a.append(int((0.90 *(a[c]))-k))
		c=c+1
	return 0.10 * sum(a)

def process():
    n=int(raw_input())
    l=0
    u=n
    a=list()
    while(l<=u):
        k=int((l+u)/2)
        a.append(n-k)
        petaya=int(sum_for_k(n,k,a))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            u=k-1
    if l==0:
        print(1)
    else:
        print(l)

process()

import math

def check(k):
	global n
	candies, eaten = n, 0
	while candies > 0:
		eaten += min(k, candies)
		candies -= min(k, candies)
		candies -= candies/10
	return eaten >= math.ceil(n/2.0)

n = input()
lo, hi = 1, n/2+1
while lo < hi:
	mid = lo + (hi-lo)/2
	if check(mid):
		hi = mid
	else:
		lo = mid+1
print hi

import math

n = int(input())
init = math.ceil(n*0.1) + 1

while True:
    aux = n
    v = 0
    p = 0

    while aux != 0:

        if(init >= aux):
            v += aux
            aux -= aux
        else:
            v += init
            aux -= init

        p += math.floor(aux*0.1)
        aux -= math.floor(aux*0.1)
    if v < p or init == 1:
        break
    init -= 1

if init == 1:
    print(init)
else:
    print(init+1)

def p(n,k) :
    k1=0
    k2=0
    while (n>0):
        k1+=min(n,k)
        n-=min(n,k)
        k2+=n//10
        n-=n//10
    if k1>k2 :
        return True
    else :
        return False

n=int(input())
p1=1
ost=n
while (p1<=ost) :
    mid=(p1+ost)//2
    if p(n,mid):
        ost=mid-1
    else :
        p1=mid+1
print(p1)

from math import ceil
inp=int(input())
print(ceil(inp/2.444987775))

import math
n = int(input())
def f(x):
    global n
    v = p = 0
    last = n
    while last > 0:
        if last >= x:
            last -= x
            v += x
        else:
            last = 0
            v += last
        p += math.floor(last * 0.1)
        last = math.ceil(last * 0.9)
    if v >= p:
        return True
    else:
        return False

left = 1
right = n
while right - left > 1:
    middle = (right + left) // 2
    if f(middle) == False:
        left = middle
    else:
        right = middle
print(right)

from math import ceil, sqrt
n = int(input())
if n < 20:
    print(1)
else:
    l = 1
    r = n//2
    s = 0
    t = n
    while l < r:
        s = 0
        mid = (r+l)//2
        while t > 0:
            if mid > t:
                s += t
                t = 0
                break
            else:
                s += mid
            t = (t - mid) - ((t-mid)//10)
        if s < ceil(n/2):
            l = mid+1
            t = n
        elif s > ceil(n/2):
            r = mid
            t = n
        elif s == ceil(n/2):
            l = mid
            break
    print(l)

n = int(input())
mid = 1+(n//2)
low = 1
high = n
while high-low > 1:
    guess = (low+high)//2
    temp = n
    ate = 0
    while temp > 0:
        if temp >= guess:
            temp -= guess
            ate += guess
            temp -= temp//10
        else:
            temp = 0
            ate += guess
    if ate >= mid:
        high = guess
    else:
        #yay new year
        low = guess
temp = n
guess = low
l = False
while temp > 0:
    ate = 0
    if temp >= guess:
        temp -= guess
        ate += guess
        temp -= temp//10
    else:
        temp = 0
        ate += guess
if ate >= mid:
    l = True
    print(low)
else:
    print(low+1)

def all(n,k):
    if k == 0:
        return False
    s = 0
    last = n
    while n != 0:
        ss = min(n,k)
        s += ss
        n -= ss
        n -= n//10
    return s > last//2
n = int(input())
def binary_search(n):
    l,r = 0,n
    midd = 0
    while l <= r:
        mid = (l+r+1)//2
        if all(n,mid):
            midd = mid
            r = mid-1
        else:
            l = mid+1
    return midd
print(binary_search(n))

def sum_for_k(n,k,a):
	c=0
	while(a[c]>=10):
		a.append(int((0.90 *(a[c]))-k))
		c=c+1
	return 0.10 * sum(a)

def process():
    n=int(raw_input())
    l=0
    u=n
    a=list()
    while(l<=u):
        k=int((l+u)/2)
        a.append(n-k)
        petaya=int(sum_for_k(n,k,a))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            u=k-1
    print(l)

process()

import math as m
def sum_for_k(n,k):
    a=list()
    c=0
    a.append(n-k)
    sum1=0
    while(a[c]>=10):
        diff=m.floor(0.10*a[c])
        a.append((a[c]-(diff+k)))
        sum1+=m.floor(0.10*a[c])
        c=c+1
    return sum1

def process():
    n=int(raw_input())
    l=0
    u=n
    while(l<=u):
        k=int((l+u)/2)
        petaya=int(sum_for_k(n,k))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            prev=k
            u=k-1#0

    if k==0:
        print(1)
    elif n%2!=0 or l==0:
        print(k)
    else:
        print(prev)

process()

import math

n = int(input())

def sim(n, k):
    v = 0
    while n > 0:
        a = min(n, k)
        n -= a
        v += a
        n -= (n//10)

    return v

l = 1
r = n

while r-l >= 0:
    mid = (r+l)//2

    if sim(n, mid) == math.ceil(n/2):
        break

    if sim(n, mid) > n/2:
        r = mid-1
    if sim(n, mid) < n/2:
        l = mid+1

if sim(n, mid) < n/2:
    while sim(n, mid) < n/2:
        mid += 1
    print(mid)

elif sim(n, mid) > n/2:
    if mid == 1:
        print(mid)
    else:
        while sim(n, mid) > n/2:
            mid -= 1

        print(mid+1)
else:
    while sim(n, mid) == n/2 and mid != 1:
        mid -= 1
    print(mid+1)

import math
n = int(input())

def test(k):
    r = n
    st = 0
    while r > 0:
        r -= k
        if r >= 10:
            st1 = math.floor(0.1 * r)
            st += st1
            r -= st1
    return n-st
b = n
a = 1
if test(a) < n/2:
    while b-a > 1:
        mid = (b + a) // 2
        vas = test(mid)
        if vas < n/2:
            a = mid
        else:
            b = mid
    if test(a) >= n/2:
        print(a)
    else:
        print(b)
else:
    print(a)

def simulate(n, k):
    m = n
    cnt = 0
    while m > 0:
        m -= k
        cnt +=k
        if m >= 0:
             m -= m // 10
    return cnt + m

# def descent(n, k):
#     s = simulate(n, k)
#     while s >= n // 2:
#         k -= 1
#         s = simulate(n, k)
#     return k + 1

def binsearch(n, l, h):
    if h == l + 1:
        return h#descent(n,h)
    m = (l + h) // 2
    s = simulate(n, m)
    if s >= n // 2:
        return binsearch(n, l, m)
    else:
        return binsearch(n, m, h)

def start(n):
    return binsearch(n, 0, n)

print(start(int(input())))

import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def getans(n,k):
	r = 0
	while n > 0:
		z = min(k, n)
		r += z
		n -= z
		n = n-(n//10)
	return r

n = mint()
r = n
l = 1
while (r-l > 1):
	c = (r+l)//2
	if getans(n,c)*2 >= n:
		r = c
	else:
		l = c
print(r)

N = int(input())
c = N + 0
dai = N
syou = 0
while N:
    if c == 0:
      c = 1
      break
    d = N +0
    tasu = 0
    while N > 0:
      if d <= c:
         tasu += d
         break
      d  -= c
      tasu += c
      e = d//10
      d -=  e
    if tasu>= N/2:
        dai = min(dai,c)
        if dai - syou == 1:
           break
        c = (dai+syou)//2

    else:
      syou = max(syou,c)
      if (syou+dai)//2 == syou:
         c = dai
         break
      c = (dai+syou)//2
print(c)

def f(n,k):
    s=0
    d=n
    while n>9:
        s=s+k

        n=n-k

        n=n-(n-n%10)/10

    s+=n

    if s>=d/2:
        return 1
    else:
        return 0

def binarySearch (n,lo, hi):

    while ( lo < hi ):
        x = lo + (hi-lo)/2

        if ( f(n,x) ):
            hi = x
        else:
            lo = x+1

    return lo

n=input()

print binarySearch(n,1,10**18)

def solve(i,n):
    tmp = n
    eaten = 0
    while(tmp > 0):
        eaten += min(tmp,i)
        tmp -= min(tmp,i)
        if(tmp>=10):
            tmp = tmp - (tmp // 10)
    #print i,eaten,n,eaten*1.0/n * 100
    if(eaten >= n/2.):
        return 1
    return 0
n = int(raw_input())
lo = 1
hi = n
while(lo<hi):
    mid = (lo + hi) / 2
    if(solve(mid,n)==1):
        hi = mid
    else:
        lo = mid+1
for i in range(max(1,lo-50),lo+100):
    if(solve(i,n)==1):
        print i
        break

def sum_for_k(n,k,a):
	c=0
	while(a[c]>=10):
		a.append(int((0.90 *(a[c]))-k))
		c=c+1
	return 0.10 * sum(a)

def process():
    n=int(raw_input())
    l=0
    u=n
    a=list()
    while(l<=u):
        k=int((l+u)/2)
        a.append(n-k)
        petaya=int(sum_for_k(n,k,a))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            u=k-1#0
    if n%2!=0 or l==0:
        print(l+1)
    else:
        print(l)

process()

from math import sqrt
n = input()
def eatcandi(n, k):
    a = 0
    b = 0
    if (n <= k):
        return n, 0, 0, True
    else:
        a = k
        b = int((n-k)*0.1)
        na, nb, nc, _= eatcandi(n - a - b, k)
        return a+na, b+nb, nc+1, (a+na) > (b+nb)
#print('n=', n)

k = int(n*0.05)
if k == 0:
    k = 1
cnt = 0
rightk = k
leftk = 0
while 1:
    lastk = k
    a, b, r, lb = eatcandi(n, k)

    if lb:  # b is True  a > b
        rightk = k
        k = k - int((rightk-leftk)/2)
    else:
        leftk = k
        k = k + int((rightk - leftk)/2)
    # print('lastk=', lastk, 'k=', k, (a, b, r, lb), (leftk, rightk))
    if (lastk == k):
        if (a == b):
            print(k)
        else:
            if not lb:
                print(k+1)
            else:
                print(k)
        break

from math import *

def cal(x):
    tem, n1, n2 = 0, ceil(n / 2), n

    while (n2 > 0 and tem < n1 and x > 0):
        tem += min(x, n2)
        n2 -= min(x, n2)
        n2 -= n2 // 10
        # print(n2, x)

    return tem

def bs(be, en, x):
    ans = 0
    while (be < en):
        mid = (be + en) // 2
        val = cal(mid)

        if val >= x:
            en = mid
        else:
            be = mid + 1
        # print(be, en, val)
    return en

n = int(input())
print(bs(0, n, ceil(n / 2)))

from math import ceil

def process(n, k):
    cnt = 0

    while n > 9:
        x = min(n, k)
        n -= x
        cnt += x
        n -= n // 10

    return cnt + n

if __name__ == '__main__':
    n = int(input())

    hi = n // 2
    lo = 1

    k = 1

    while hi > lo:
        mid = (hi + lo) // 2

        p1 = process(n, mid)
        p2 = process(n, mid - 1)

        b1 = p1 >= n // 2
        b2 = p2 < n // 2

        k = mid

        if p2 > p1:
            print(mid)

        if b1 and b2:
            break
        elif not b1:
            lo = mid
        else:
            hi = mid

    print(k)

"""."""

def get_win(cakes_nr, step):
    """."""
    win = 0
    while True:
        if cakes_nr <= step:
            win += cakes_nr
            break
        win += step
        cakes_nr -= step
        cakes_nr -= cakes_nr // 10
    return win

print(2 * get_win(999999999999999973, 39259424579862574))
print(2 * get_win(999999999999999973, 39259424579862572))

cakes_nr = int(input())
l_op = 0
r_cl = cakes_nr

while r_cl - l_op > 1:
    m = (l_op + r_cl) // 2
    win = get_win(cakes_nr, m)
    if win >= (cakes_nr + 1) // 2:
        r_cl = m
    else:
        l_op = m

# curr_best = cakes_nr
# for i in range(-50_000, 50_001):
#     if r_cl - i <= 0 or r_cl - i > cakes_nr:
#         continue
#     win = get_win(cakes_nr, r_cl - i)
#     if win >= cakes_nr / 2:
#         curr_best = r_cl - i

print(r_cl)

def sum_for_k(n,k,a):
	c=0
	while(a[c]>=10):
		a.append(int((0.90 *(a[c]))-k))
		c=c+1
	return 0.10 * sum(a)

def process():
    n=int(raw_input())
    l=0
    u=n
    a=list()
    while(l<=u):
        k=int((l+u)/2)
        a.append(n-k)
        petaya=int(sum_for_k(n,k,a))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            u=k-1
    print(k+1)

process()

n = int(input())
l, r = 0, 10 ** 18

def enough(n, k):
    was = n
    eaten = 0
    while n > 0:
        eaten += min(n, k)
        n -= k
        if n > 0:
            n -= n // 10
    return eaten >= was / 2

while l + 1 < r:
    m = (l + r) // 2
    if not enough(n, m):
        l = m
    else:
        r = m
print(r)

"""
http://codeforces.com/problemset/problem/991/C
NNNNNNNYYYYYY Problem
"""
import math
def solveBinarySearch(n):

	lo = 1
	hi = n
	# import pdb; pdb.set_trace()
	while (lo < hi):

		mid = (lo + hi) / 2
		candies_eaten = computeNumCandies(mid, n)
		if (candies_eaten >= n / 2):
		# if (helper(n, mid)):
			hi = mid

		else :
			lo = mid + 1
	return lo

def helper(n, k):
    a, b = 0, 0
    while n > 0:
        if n >= k:
            a += k
        else:
            a += n
        n -= k
        if n > 9:
            b += n/10
            n -= n/10
    return a >= b

def computeNumCandies(mid, n):
	num_candies = n
	candies_eaten = 0
	# import pdb; pdb.set_trace()
	while (num_candies > 0):
		# Vasya eats them all
		if (num_candies <= mid):
			candies_eaten += num_candies
			num_candies = 0
			return candies_eaten
		else: #Vasya takes mid candies
			num_candies = num_candies - mid
			candies_eaten += mid

		#Petya rounds down the remaining candy
		if (num_candies > 9):
			petya_eats = math.floor(num_candies / 10.0)
			num_candies = num_candies - petya_eats
	return candies_eaten

n = int(input())
print(solveBinarySearch(n))

def check(n,k):
    v = 0
    p = 0
    num = n
    while n>0:
        v+=min(n,k)
        n-=min(n,k)
        if n>=10:
            p+=(n//10)
            n-=(n//10)
    return v*2 >= num
n = int(input())

low,high = 1,n

while low<=high:
    mid = (low+high)//2
    if check(n,mid):
        high = mid - 1
    else:
        low = mid + 1
print(mid)

import math

n = int(input())
init = math.floor(n*0.1) + 1
while True:
    aux = n
    v = 0
    p = 0

    while aux != 0:

        if(init >= aux):
            v += aux
            aux -= aux
        else:
            v += init
            aux -= init

        p += math.floor(aux*0.1)
        aux -= math.floor(aux*0.1)

    if v < p or p == 0:
        break
    init -= 1

print(init+1)

def p(n,k) :
    k1=0
    k2=0
    while (n>0):
        k1+=min(n,k)
        n-=min(n,k)
        k2+=n//10
        n-=n//10
    if k1>k2 :
        return True
    else :
        return False

n=int(input())
p1=1
ost=n
while (p1<=ost) :
    mid=(p1+ost)//2
    if p(n,mid):
        ost=mid-1
    else :
        p1=mid+1
print(p1)

def check(n,k):
    v = 0
    p = 0
    num = n
    while n>0:
        v+=min(n,k)
        n-=min(n,k)
        if n>=10:
            p+=(n//10)
            n-=(n//10)
    return v*2 >= num
n = int(input())

low,high = 1,n

while low<=high:
    mid = (low+high+1)//2
    if check(n,mid):
        high = mid - 1
    else:
        low = mid + 1
print(mid)

def f(n,k):
    s=0
    d=n
    while n>9:
        s=s+k

        n=n-k

        n=n-(n-n%10)/10

    s+=n

    if 2*s>=d:
        return 1
    else:
        return 0

def binarySearch (n,lo, hi):

    while ( lo < hi ):
        x = lo + (hi-lo)/2

        if ( f(n,x) ):
            hi = x
        else:
            lo = x+1

    return lo

n=input()

print binarySearch(n,1,n)

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations

sys.setrecursionlimit(10000)

def read_int():
    return int(input())

def read_int_n():
    return list(map(int, input().split()))

def read_float():
    return float(input())

def read_float_n():
    return list(map(float, input().split()))

def read_str():
    return input()

def read_str_n():
    return list(map(str, input().split()))

def error_print(*args):
    print(*args, file=sys.stderr)

def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap

def sim(n, k):
    ans = 0
    while n > 0:
        if n >= k:
            ans += k
            n -= k
        else:
            ans += n
            n = 0

        n -=  n //10

    return ans

def slv2(N):
    for k in range(1, N):
        if sim(N, k) >= N/2:
            return k
    return 1

@mt
def slv(N):
    if N < 1000:
        return slv2(N)

    sk = int(N*0.03)
    ek = int(N*0.1)
    cnd = {}
    while True:
        if ek - sk <= 1:
            break
        ck = (sk + ek)//2
        v = sim(N, ck)
        cnd[ck] = v
        if v <= N/2:
            sk = ck
        else:
            ek = ck

    keys = sorted(cnd.keys())
    for i, k in enumerate(keys):
        if cnd[k] >= N/2:
            error_print(keys[i-1], keys[i])
            for j in range(keys[i-1], keys[i]):
                cnd[j] = sim(N, j)
            break
    keys = sorted(cnd.keys())
    for i, k in enumerate(keys):
        if cnd[k] >= N/2:
            return k

def main():
    N = read_int()
    # N = int(1e+18)
    # N = random.randint(int(1e+18)-10000, int(1e+18))
    print(slv(N))

    # for n in range(1000000, 1000000+10):
    #     print(n)
    #     a = slv(n)
    #     b = slv2(n)
    #     if a != b:
    #         print(n, a, b)
    #         break

if __name__ == '__main__':
    main()

def process(n, k):
    cnt = 0

    while n > 9:
        x = min(n, k)
        n -= x
        cnt += x
        n -= n // 10

    return cnt + n

if __name__ == '__main__':
    n = int(input())

    hi = n // 2
    lo = 1

    k = None

    while hi > lo:
        mid = (hi + lo) // 2
        b1 = process(n, mid) >= n // 2
        b2 = process(n, mid - 1) < n // 2

        k = mid

        if b1 and b2:
            break
        elif not b1 and not b2:
            lo = mid
        else:
            hi = mid

    print(k)

from sys import stdin, stdout
ti = lambda : stdin.readline().strip()
ma = lambda fxn, ti : map(fxn, ti.split())
ol = lambda arr : stdout.write(' '.join(str(i) for i in arr) + '\n')
os = lambda i : stdout.write(str(i) + '\n')
olws = lambda arr : stdout.write(''.join(str(i) for i in arr) + '\n')

n = int(ti())
l = 1
r = n
ans = n
def ksuits(k, l, r, n):
	cur = n
	petya = 0
	vasya = 0
	while cur > 0:
		if cur < 10:
			vasya += cur
			cur = 0
		else:
			vasya += k
			cur -= k
			petya += cur/10
			cur -= cur/10
	return vasya*2 >= n

while l <= r:
	k = (l+r)/2
	if ksuits(k, l, r, n):
		ans = k
		r = k-1
	else:
		l = k+1
os(ans)

import math as m
def sum_for_k(n,k):
    a=list()
    c=0
    a.append(n-k)
    sum1=0
    while(a[c]>=10):
        diff=m.floor(0.10*a[c])
        a.append((a[c]-(diff+k)))
        sum1+=m.floor(0.10*a[c])
        c=c+1
    return sum1

def process():
    n=int(raw_input())
    l=0
    u=n
    while(l<=u):
        k=int((l+u)/2)
        petaya=int(sum_for_k(n,k))
        vatsaya=n-petaya
        if vatsaya<petaya:
            l=k+1
        else:
            prev=k
            u=k-1#0

    if k==0:
        print(1)
    elif prev==-1:
        print(k)
    else:
        print(prev)

process()

import math

n = int(input())

def sim(n, k):
    v = 0
    while n > 0:
        a = min(n, k)
        n -= a
        v += a
        n -= (n//10)

    return v

l = 1
r = n

while r-l >= 0:
    mid = (r+l)//2

    if sim(n, mid) == math.ceil(n/2):
        break

    if sim(n, mid) > n/2:
        r = mid-1
    if sim(n, mid) < n/2:
        l = mid+1

if mid == 1:
    print(mid)
else:
    if sim(n, mid) < n/2:
        while sim(n, mid) < n/2:
            mid += 1
        print(mid)

    elif sim(n, mid) > n/2:
        while sim(n, mid) > n/2:
            mid -= 1

        print(mid+1)
    else:
        while sim(n, mid) == n/2:
            mid -= 1
        print(mid+1)

def greater(nowcandy, x):
	vas = 0
	pet = 0
	while nowcandy > 0:
		if nowcandy > x:
			nowcandy = nowcandy - x
			vas = vas + x
		else:
			vas = vas + nowcandy
			nowcandy = 0
		pet = pet + int(nowcandy / 10)
		nowcandy = nowcandy - int(nowcandy/10)
	print(vas, pet)
	if vas >= pet:
		return True
	else:
		return False

candies = int(input())

lo = 1
hi = 10000000000

while lo < hi:
	mid = (lo + hi) // 2
	if greater(candies, mid):
		hi = mid
	else:
		lo = mid + 1
print(lo)

from math import *

def cal(x):
    tem, n1, n2 = 0, ceil(n / 2), n

    while (n2 > 0 and tem < n1):
        tem += min(x, n2)
        n2 -= min(x, n2)
        n2 -= n2 // 10
        # print(n2, x)

    return tem

def bs(be, en, x):
    ans = 0
    while (be + 1 < en):
        mid = ceil((be + en) / 2)
        val = cal(mid)

        if val >= x:
            en = mid
        else:
            be = mid + 1
        # print(be, en, val)
    return en

n = int(input())
print(bs(0, n, ceil(n / 2)))

N = int(input())
c = N + 0
dai = N
syou = 0
while N:
    if c == 0:
      c = 1
      break
    d = N +0
    tasu = 0
    while N > 0:
      if d <= c:
         tasu += d
         break
      d  -= c
      tasu += c
      e = d//10
      d -=  e
    if tasu>= N/2:
        dai = min(dai,c)
        if dai - syou == 1:
           break
        c = (dai+syou)//2

    else:
      syou = max(syou,c)
      if (syou+dai)//2 == syou:
         c = dai
         break
      c = (dai+syou)//2
print(c)

n = int(input())
l, r = 0, 10 ** 20

def enough(n, k):
    was = n
    eaten = 0
    while n > 0:
        eaten += min(n, k)
        n -= k
        if n > 0:
            n -= n // 10
    return eaten >= was / 2

while l + 1 < r:
    m = (l + r) // 2
    if not enough(n, m):
        l = m
    else:
        r = m
print(r)

"""
http://codeforces.com/problemset/problem/991/C
NNNNNNNYYYYYY Problem
"""
import math
def solveBinarySearch(n):

	lo = 1
	hi = n
	# import pdb; pdb.set_trace()
	while (lo < hi):

		mid = (lo + hi) / 2
		candies_eaten = computeNumCandies(mid, n)
		if (candies_eaten):
		# if (helper(n, mid)):
			hi = mid

		else :
			lo = mid + 1
	return lo

def computeNumCandies(mid, n):
	num_candies = n
	candies_eaten = 0
	pet_eaten = 0
	# import pdb; pdb.set_trace()
	while (num_candies > 0):
		# Vasya eats them all
		if (num_candies < mid):
			candies_eaten += num_candies
			num_candies = 0
			return candies_eaten >= n / 2
		else: #Vasya takes mid candies
			num_candies = num_candies - mid
			candies_eaten += mid
		# num_candies = num_candies - mid

		#Petya rounds down the remaining candy
		# if (num_candies > 9):
		petya_eats = num_candies / 10
		num_candies = num_candies - petya_eats
		pet_eaten = pet_eaten + petya_eats

	return candies_eaten >= n / 2

n = int(input())
print(solveBinarySearch(n))

n = int(input())
mid = 1+((n-1)//2)
low = 1
high = n
while high-low > 1:
    guess = (low+high)//2
    temp = n
    ate = 0
    while temp > 0:
        if temp >= guess:
            temp -= guess
            ate += guess
            temp -= temp//10
        else:
            temp = 0
            ate += temp
    if ate >= mid:
        high = guess
    else:
        #yay new year
        low = guess
temp = n
guess = low
l = False
ate = 0
while temp > 0:
    if temp >= guess:
        temp -= guess
        ate += guess
        temp -= temp//10
    else:
        temp = 0
        ate += temp
if ate >= mid:
    l = True
    print(low)
else:
    print(low+1)

def fun(n,k):
    s1=0
    s2=n
    while s2>0:
        temp = min(k,s2)
        s2-=temp
        s1+=temp
        s2-=s2/10
    if s1*2>=n:
        return True
    return False

n=input()
k=1
while True:
    if fun(n,k):
        break
    else:
        k*=2
k=k/2
for l in range(k,2*k):
    if fun(n,l):
        print l
        break

def simulate(n, k):
    m = n
    cnt = 0
    while m > 0:
        m -= k
        cnt +=k
        if m >= 0:
             m -= m // 10
    return cnt + m

# def descent(n, k):
#     s = simulate(n, k)
#     while s >= n // 2:
#         k -= 1
#         s = simulate(n, k)
#     return k + 1

def binsearch(n, l, h):
    if h == l + 1:
        return h
    m = (l + h) // 2
    s = simulate(n, m)
    if s >= n / 2:
        return binsearch(n, l, m)
    else:
        return binsearch(n, m, h)

def start(n):
    return binsearch(n, 0, n)

print(start(int(input())))

import sys

def ok(k,n):
	if k == 0:
		return False
	vasya = 0
	petya = 0
	N = n
	while n:
		vasya_i = min(n,k)
		vasya += vasya_i
		petya_i = int((N - (vasya + petya))/float(10))
		petya += petya_i
		n -= petya_i + vasya_i
	return vasya > petya

def sol(n):
	low = 0
	high = n
	ans = high
	while low <= high:
		mid = (low+high)/2
		if ok(mid,n):
			ans = min(ans,mid)
			high = mid-1
		else:
			low = mid+1
	return ans

n = int(sys.stdin.readline().strip())
print(sol(n))

n = int(input())

lo = 1
hi = n

def check(k):
    global n
    cp = n
    a = 0
    b = 0
    while n>0:
        a += min(n, k)
        n -= min(n, k)
        if n==0:
            break
        b += n//10
        n -= n//10
        if n<=0:
            break
    #print('for',k,a,b)
    n = cp
    return a>=b

while lo+1<hi:
    #print(lo, hi)
    mid = (lo+hi+1)//2

    if check(mid):
        hi = mid
    else:
        lo = mid+1
mid = (lo+hi+1)//2
print(mid)

import sys

def cas(mid,n):
	calc1 = 0
	calc2 = 0
	s = n
	while(calc2 < n/2 and calc1 < n/2 and s > 0):
		v = min(mid,s)
		s -= v
		calc1 += v
		s -= s//10
		calc2 += s//10
	# 	print(calc1)
	# 	print(calc2)
	# print(calc1)
	# print(calc2)
	# print(s)
	if(calc1 >= n/2):
		return 1
	else:

		return -1

def binS(begin,end,n):
	mid = (begin + end) //2
	p = cas(mid,n)
	q = cas(mid+1,n)
	if(end < begin):
		return 7
	if(p == -1 and q == 1):
		return mid + 1
	elif(p == -1 and q == -1):
		return binS(mid+1,end,n)
	elif(p == 1 and q == 1):
		# print("------",mid)
		# print(mid)
		return binS(begin,mid-1,n)
	else:
		return -1

# sys.setrecursionlimit(15000)
n = int(input())
if(n<22):
	print(1)
else:
	p = int(pow(n,0.5))
	print(binS(0,int(n/2),n))

'''input
43
'''
def check(m, k):
	n = m
	got = 0
	while n:
		if n >= k:
			n -= k
			got += k
		else:
			got += n
			n = 0
		n -= n // 10
	if got >= m / 2:
		return 1
	return 0
n = int(input())
if n < 100:
	for i in range(1, 100):
		if check(n, i):
			print(i)
			break
else:
	l = 1
	h = n
	while l <= h:
		mid = (l + h) // 2
		z = check(n, mid)
		if z == 1:
			#can eat 50 %
			h = mid - 1
		else:
			#can not eat 50 %
			l = mid + 1
	print(mid)

import math

def check(k):
	global n
	candies, eaten = n, 0
	while candies > 0:
		eaten += min(k, candies)
		candies -= min(k, candies)
		candies -= candies/10
	return eaten >= math.ceil(n/2.0)

n = input()
lo, hi = 1, n
while lo < hi:
	mid = lo + (hi-lo)/2
	if check(mid):
		hi = mid
	else:
		lo = mid+1
print hi

n = int(input())

for i in range(1, n):
    v = 0
    p = 0
    start = n
    while start > 0:
        if start <= i:
            v += start
            start = 0
        else:
            start -= i
            v += i

        p += int(start / 10)
        start -= int(start / 10)
    if v >= n / 2:
        print(i)
        break

def Check(mid):
    N = n
    S1 = 0
    while N > 0:
        if N < mid:
            S1 += N
            N = 0
        else:
            S1 += mid
            N -= mid
            N -= int(0.1*N)
    return S1 >= (n+1)//2
n = int(input())
l = 0
r = n
while l < r - 1:
    mid = (l+r)//2
    if Check(mid):
        r = mid
    else:
        l = mid
print(r)

#import resource
#import sys
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#sys.setrecursionlimit(0x10000000)

from sys import stdin, stdout
def GCD(x, y):
   while(y):
       x, y = y, x % y
   return x
def BS(arr, l, r, x):
    if r >= l:
        mid = l + (r - l)/2
        if arr[mid] == x:
            return mid
        elif arr[mid] > x:
            return BS(arr, l, mid-1, x)
        else:
            return BS(arr, mid+1, r, x)
    else:
        return -1
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import math
import Queue
a=input()
h=10**18
l=1
k=10**18
w=int(round(a/2.0))
while(h>=l):
    m=(h+l)/2
    r=0
    e=a
    while(e>0):
        r+=min(m,e)
        e-=min(m,e)
        if(e<10):
            continue
        else:
            q=int(e*0.1)
            e-=q
    if(r>=w):
        h=m-1
        if(m<k):
            k=m
    else:
        l=m+1
print k

# @oj: codeforces
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-04-28 15:31
# @url:https://codeforces.com/problemset/problem/991/C
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
# region fastio

BUFSIZE = 8192

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# ------------------------------
def main():
    n=int(input())
    l,r=1,math.ceil(n/2)
    def check(m,n):
        v,p=0,0
        temp=math.ceil(n/2)
        while n>0:
            v+=min(m,n)
            n-=m
            if n>=10:
                p+=(n//10)
            n-=(n//10)
        # print (m,v,p)
        return v>=temp
    while l<r:
        mid=(l+r)//2
        if check(mid,n):
            r=mid
        else:
            l=mid+1
    print (l)
if __name__ == "__main__":
    main()

import math

def f(n,choc):
    m,vas=n,0
    while m>0:
        u=min(choc,m)
        vas+=u
        m-=u
        m-=m//10
    return vas

n=int(input())
t=math.ceil(n/2)

a=[]
low,high=1,n
while(low<=high):
    mid=low+(high-low)//2
    x=f(n,mid)
    if x<t:
        low=mid+1
    else:
        a.append(mid)
        high=mid-1

print(min(a))

def simulate(n, k):
    m = n
    cnt = 0
    while m > 0:
        m -= k
        cnt +=k
        if m >= 0:
             m -= m // 10
    return cnt + m

def binsearch(n, l, h):
    if h == l + 1:
        return h
    m = (l + h) // 2
    s = simulate(n, m)
    if s >= n / 2:
        return binsearch(n, l, m)
    else:
        return binsearch(n, m, h)

def start(n):
    return binsearch(n, 0, n)

print(start(int(input())))

"""
http://codeforces.com/problemset/problem/991/C
NNNNNNNYYYYYY Problem
"""
import math
def solveBinarySearch(n):

	lo = 1
	hi = n
	# import pdb; pdb.set_trace()
	while (lo < hi):

		mid = (lo + hi) / 2
		candies_eaten = computeNumCandies(mid, n)
		if (candies_eaten):
		# if (helper(n, mid)):
			hi = mid

		else :
			lo = mid + 1
	return lo

def computeNumCandies(mid, n):
	num_candies = n
	candies_eaten = 0
	pet_eaten = 0
	# import pdb; pdb.set_trace()
	while (num_candies > 0):
		# Vasya eats them all
		if (num_candies < mid):
			candies_eaten += num_candies
			num_candies = 0
			return candies_eaten
		else: #Vasya takes mid candies
			num_candies = num_candies - mid
			candies_eaten += mid
		# num_candies = num_candies - mid

		#Petya rounds down the remaining candy
		# if (num_candies > 9):
		petya_eats = num_candies / 10
		num_candies = num_candies - petya_eats
		pet_eaten = pet_eaten + petya_eats

	return candies_eaten >= pet_eaten

n = int(input())
print(solveBinarySearch(n))

R = lambda: map(int, input().split())
n = int(input())
l, r = 1, n
while l < r:
    m = (l + r) // 2
    nc, vc = n, 0
    while nc > 0:
        nc -= min(m, nc)
        vc += min(m, nc)
        nc -= nc // 10
    if vc * 2 >= n:
        r = m
    else:
        l = m + 1
print(l)

def check(n, k):
    vasya, curr = 0, n
    while curr > 0:
        # vasya takes first k or whatever left
        vasya_take = min(n, k)
        vasya += vasya_take
        curr -= vasya_take
        # petya takes 10% if more than 10 left
        if curr >= 10:
            curr -= int(curr * 0.1)

    return vasya * 2 >= n

def find_min_k(n):
    start, end, min_k  = 0, n, n

    while abs(start - end) > 1:
        middle = (start + end) // 2

        if check(n, middle):
            min_k = min(min_k, middle)
            end = middle
        else:
            start = middle

    return min_k

print(find_min_k(int(input())))

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations

sys.setrecursionlimit(10000)

def read_int():
    return int(input())

def read_int_n():
    return list(map(int, input().split()))

def read_float():
    return float(input())

def read_float_n():
    return list(map(float, input().split()))

def read_str():
    return input()

def read_str_n():
    return list(map(str, input().split()))

def error_print(*args):
    print(*args, file=sys.stderr)

def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap

def sim(n, k):
    ans = 0
    while n > 0:
        if n >= k:
            ans += k
            n -= k
        else:
            ans += n
            n = 0

        n -= int(math.floor(n*0.1))

    return ans

def slv2(N):
    for k in range(1, N):
        if sim(N, k) > N/2:
            return k

@mt
def slv(N):
    if N < 1000:
        for k in range(1, N):
            if sim(N, k) > N/2:
                return k

    sk = int(N*0.03)
    ek = int(N*0.1)
    cnd = {}
    while True:
        if ek - sk <= 1:
            break
        ck = (sk + ek)//2
        v = sim(N, ck)
        cnd[ck] = v
        if v < N/2:
            sk = ck
        else:
            ek = ck

    keys = sorted(cnd.keys())
    for i, k in enumerate(keys):
        if cnd[k] > N/2:
            error_print(keys[i-1], keys[i])
            for j in range(keys[i-1], keys[i]):
                cnd[j] = sim(N, j)
            break
    keys = sorted(cnd.keys())
    for i, k in enumerate(keys):
        if cnd[k] > N/2:
            return k

def main():
    N = read_int()
    # N = int(1e+18)
    # N = random.randint(int(1e+18)-10000, int(1e+18))
    print(slv(N))

    # for n in range(1000, 100000):
    #     print(n)
    #     a = slv(n)
    #     b = slv2(n)
    #     if a != b:
    #         print(n, a, b)
    #         break

if __name__ == '__main__':
    main()

import sys

def ok(k,n):
	if k == 0:
		return False
	vasya = 0
	petya = 0
	N = n
	while n:
		vasya_i = min(n,k)
		vasya += vasya_i
		petya_i = int((N - (vasya + petya))/float(10))
		petya += petya_i
		n -= petya_i + vasya_i
	return vasya >= petya

def sol(n):
	low = 0
	high = n
	ans = high
	while low <= high:
		mid = (low+high)/2
		if ok(mid,n):
			ans = min(ans,mid)
			high = mid-1
		else:
			low = mid+1
	return ans

n = int(sys.stdin.readline().strip())
print(sol(n))

"""
http://codeforces.com/problemset/problem/991/C
NNNNNNNYYYYYY Problem
"""
import math
def solveBinarySearch(n):

	lo = 1
	hi = n
	# import pdb; pdb.set_trace()
	while (lo < hi):

		mid = (lo + hi) / 2
		candies_eaten = computeNumCandies(mid, n)
		if (candies_eaten):
		# if (helper(n, mid)):
			hi = mid

		else :
			lo = mid + 1
	return lo

def helper(n, k):
    a, b = 0, 0
    while n > 0:
        if n >= k:
            a += k
        else:
            a += n
        n -= k
        if n > 9:
            b += n/10
            n -= n/10
    return a >= b

def computeNumCandies(mid, n):
	num_candies = n
	candies_eaten = 0
	pet_eaten = 0
	# import pdb; pdb.set_trace()
	while (num_candies > 0):
		# Vasya eats them all
		if (num_candies < mid):
			candies_eaten += num_candies
			num_candies = 0
			return candies_eaten
		else: #Vasya takes mid candies
			num_candies = num_candies - mid
			candies_eaten += mid

		#Petya rounds down the remaining candy
		# if (num_candies > 9):
		petya_eats = num_candies / 10
		num_candies = num_candies - petya_eats
		pet_eaten = pet_eaten + petya_eats

	return candies_eaten >= pet_eaten

n = int(input())
print(solveBinarySearch(n))

def simulate(n, k):
    m = n
    cnt = 0
    while m > 0:
        m -= k
        cnt +=k
        if m >= 0:
             m -= m // 10
    return cnt + m

# def descent(n, k):
#     s = simulate(n, k)
#     while s >= n // 2:
#         k -= 1
#         s = simulate(n, k)
#     return k + 1

def binsearch(n, l, h):
    if h == l + 1:
        return h
    m = (l + h) // 2
    s = simulate(n, m)
    if s > n // 2:
        return binsearch(n, l, m)
    else:
        return binsearch(n, m, h)

def start(n):
    return binsearch(n, 0, n)

print(start(int(input())))

from math import ceil
def all(n,k):
    if k == 0:
        return False
    s = 0
    last = n
    while n != 0:
        ss = min(n,k)
        s += ss
        n -= ss
        n -= n//10
    return s >= ceil(last/2)
n = int(input())
def binary_search(n):
    l,r = 0,n
    midd = 0
    while l <= r:
        mid = (l+r+1)//2
        if all(n,mid):
            midd = mid
            r = mid-1
        else:
            l = mid+1
    return midd
print(binary_search(n))

"""."""

def get_win(cakes_nr, step):
    """."""
    win = 0
    while True:
        if cakes_nr <= step:
            win += cakes_nr
            break
        win += step
        cakes_nr -= step
        cakes_nr -= cakes_nr // 10
    return win

cakes_nr = int(input())
l_op = 0
r_cl = cakes_nr

while r_cl - l_op > 1:
    m = (l_op + r_cl) // 2
    win = get_win(cakes_nr, m)
    if win >= cakes_nr / 2:
        r_cl = m
    else:
        l_op = m

curr_best = r_cl
for i in range(-50_000, 50_001):
    if r_cl - i <= 0 or r_cl - i > cakes_nr:
        continue
    win = get_win(cakes_nr, r_cl - i)
    if win >= cakes_nr / 2:
        curr_best = r_cl - i

print(curr_best)

import sys
import bisect
# import heapq
from math import ceil,floor

def check(k,n):
    fr = 0
    temp=  n
    while ( n > 0):
        if n < k :
            fr = fr+n
            n = 0
        else:
            fr = fr + k
            n = n-k
            n -= (n//10)
    return fr*2>= temp

RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
mod = 10**9+7
# for _ in range(int(ri())):

n = int(ri())
l = 1
r = n
ans = 10**10
while ( l <= r):
    mid = (l+r)//2
    if check(mid,n):
        r = mid-1
        ans = min(ans,mid)
    else:
        l = mid+1
print(ans)

n = int(input())
l, r = 0, 2 * 10 ** 18

def enough(n, k):
    was = n
    eaten = 0
    while n > 0:
        eaten += min(n, k)
        n -= k
        if n > 0:
            n -= n // 10
    return eaten >= was / 2

while l + 1 < r:
    m = (l + r) // 2
    if not enough(n, m):
        l = m
    else:
        r = m
print(r)

n=input()
def answer(n,k):
  vr=0
  while n>9 and k<n:
    if 1==1:
      n=n-k
    vr=vr+k

    if n>9:
      n=n-n/10

  if n>0:
    vr=vr+n
  return vr
low=1
high=10**18
i=0
c=0
mid=(low+high)/2
for i in range(1,300):
  if answer(n,mid)<int(round(n*1.0/2)):
    low=mid
    mid=(low+high)/2
  elif answer(n,mid)>int(round(n*1.0/2)):
    high=mid
    mid=(low+high)/2

if answer(n,low)>=int(round(n*1.0/2)):
  print low
elif answer(n,mid)>=int(round(n*1.0/2)):
  print mid
else:
  print high

def check(n,k):
    v = 0
    p = 0
    num = n
    while n>0:
        v+=min(n,k)
        n-=min(n,k)
        if n>=10:
            p+=(n//10)
            n-=(n//10)
    return v*2 >= num
n = int(input())

low,high = 1,n

while low<=high:
    mid = (low+high+1)//2
    if check(n,mid):
        high = mid - 1
    else:
        low = mid + 1
print(mid)

def check(n,k):
    if k==0:
        return 0
    v = 0
    p = 0
    num = n
    while n>0:
        v+=min(n,k)
        n-=min(n,k)
        if n>=10:
            p+=(n//10)
            n-=(n//10)
    return v*2 >= num
n = int(input())

low,high = 1,n

while low<=high:
    mid = (low+high)//2
    if check(n,mid) and check(n,mid+1):
        high = mid - 1
    elif check(n,mid) and not check(n,mid-1):
        break
    elif not check(n,mid) and not check(n,mid-1):
        low = mid + 1
print(mid)

from math import ceil, sqrt
n = int(input())
if n < 20:
    print(1)
else:
    l = 1
    r = n//2
    s = 0
    t = n
    while l < r:
        s = 0
        mid = (r+l)//2
        while t > 0:
            if mid > t:
                s += t
                t = 0
                break
            else:
                s += mid
            t = (t - mid) - ((t-mid)//10)
        if s < ceil(n/2):
            l = mid+1
            t = n
        elif s > ceil(n/2):
            r = mid
            t = n
        elif s == ceil(n/2):
            l = mid
            break
    print(l)

def ans(n, k):
    sm = 0
    while n - k - (n - k) // 10 > 0:
        n = n - k - (n - k) // 10
        sm += k
    sm += n
    return sm

def binarySearch(arr, x):
    l = 0
    r = len(arr) - 1
    while l <= r:

        mid = (l + r) // 2

        if arr[mid] == x:
            return mid + 1
        elif arr[mid] < x:
            l = mid + 1
        else:
            r = mid - 1
    return l

n = int(input())

l = 1
s = 0
r = n
while l <= r:
    mid = (l + r) // 2
    t = ans(n,mid)
    if t == n//2:
        s = mid
        break
    elif t < n//2:
        l = mid + 1
    else:
        r = mid - 1
        s = mid
print(s)

#      Codeforces Round #491 (Div. 2)
import collections
from functools import cmp_to_key
#key=cmp_to_key(lambda x,y: 1 if x not in y else -1 )
import math
import sys
def getIntList():
    return list(map(int, input().split()))

import bisect
try :
    import numpy
    dprint = print
    dprint('debug mode')
except ModuleNotFoundError:
    def dprint(*args, **kwargs):
        pass
def makePair(z):
    return  [(z[i], z[i+1]) for i in range(0,len(z),2) ]

n, = getIntList()

def work(k,n):
    a = 0
    b = 0
    while(n>0):
        a += min(n,k)
        if n<=k:
            break
        n-=k
        t = int(n/10)
        b +=t
        n-=t
    if a>=b:
        return True
    return False

r0 = 0
r1 = n

while r0+1<r1 :
    m = (r0+r1)//2
    if work(m,n):
        r1 = m
    else :
        r0 = m

print(r1)

def p(n,k) :
    k1=0
    k2=0
    while (n>0):
        k1+=min(n,k)
        n-=min(n,k)
        k2+=n//10
        n-=n//10
    if k1>k2 :
        return True
    else :
        return False

n=int(input())
p1=1
ost=n
while (p1<=ost) :
    mid=(p1+ost)//2
    if p(n,mid):
        ost=mid-1
    else :
        p1=mid+1
print(p1)

from sys import stdin
input=lambda : stdin.readline().strip()
from math import ceil,sqrt,factorial,gcd
from collections import deque
def check(n,k):
	a=0
	b=0
	while n>0:
		if k<=n:
			a+=k
			n-=k
		else:
			a+=n
			n=0
		if n>=10:
			b+=n//10
			n-=n//10
	if a>b:
		return True
	return False

n=int(input())
l=1
r=n
while l<r:
	mid=(l+r)//2
	# print(mid,l,r)
	if check(n,mid):
		r=mid-1
	else:
		l=mid+1
print(l)