After passing a test, Vasya got himself a box of $n$ candies. He decided to eat an equal amount of candies each morning until there are no more candies. However, Petya also noticed the box and decided to get some candies for himself.

This means the process of eating candies is the following: in the beginning Vasya chooses a single integer $k$, same for all days. After that, in the morning he eats $k$ candies from the box (if there are less than $k$ candies in the box, he eats them all), then in the evening Petya eats $10\%$ of the candies remaining in the box. If there are still candies left in the box, the process repeats — next day Vasya eats $k$ candies again, and Petya — $10\%$ of the candies left in a box, and so on.

If the amount of candies in the box is not divisible by $10$, Petya rounds the amount he takes from the box down. For example, if there were $97$ candies in the box, Petya would eat only $9$ of them. In particular, if there are less than $10$ candies in a box, Petya won't eat any at all.

Your task is to find out the minimal amount of $k$ that can be chosen by Vasya so that he would eat at least half of the $n$ candies he initially got. Note that the number $k$ must be integer.


-----Input-----

The first line contains a single integer $n$ ($1 \leq n \leq 10^{18}$) — the initial amount of candies in the box.


-----Output-----

Output a single integer — the minimal amount of $k$ that would allow Vasya to eat at least half of candies he got.


-----Example-----
Input
68

Output
3



-----Note-----

In the sample, the amount of candies, with $k=3$, would change in the following way (Vasya eats first):

$68 \to 65 \to 59 \to 56 \to 51 \to 48 \to 44 \to 41 \\ \to 37 \to 34 \to 31 \to 28 \to 26 \to 23 \to 21 \to 18 \to 17 \to 14 \\ \to 13 \to 10 \to 9 \to 6 \to 6 \to 3 \to 3 \to 0$.

In total, Vasya would eat $39$ candies, while Petya — $29$.

Source: codeforces | Difficulty: MEDIUM
Tags: Sorting

Implementation


Solutions:
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)


def my_fun(n, k):
	(v, p) = (0, 0)
	while n:
		v += min(k, n)
		n = max(n - k, 0)
		p += n // 10
		n -= n // 10
	return v >= p
m = int(input())
(low, high) = (1, m)
while low <= high:
	mid = (low + high) // 2
	if my_fun(m, mid):
		high = mid - 1
	else:
		low = mid + 1
print(low)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
lo = 1
hi = n

def check(k):
	vasya = 0
	m = n
	while m > 0:
		t = min(m, k)
		m -= t
		vasya += t
		m -= m // 10
	return vasya >= n // 2 + n % 2
while lo < hi:
	mid = (lo + hi) // 2
	if check(mid):
		hi = mid
	else:
		lo = mid + 1
print(lo)


def solve(n, k):
	sum = 0
	maxx = n
	while maxx > 0:
		c = min(maxx, k)
		sum += c
		maxx -= c
		maxx -= maxx // 10
	return 2 * sum >= n

def binarySearch(l, r):
	ans = r
	while l <= r:
		k = (r + l) // 2
		if solve(n, k):
			ans = k
			r = k - 1
		else:
			l = k + 1
	return ans
import sys
n = int(sys.stdin.readline())
print(binarySearch(1, n))


def good(N, k):
	c = 0
	m = N
	while m > 0:
		a = min(k, m)
		m -= a
		c += a
		m -= m // 10
	return c * 2 >= N

def solve(N):
	lb = 0
	ub = N
	while ub - lb > 1:
		mid = (ub + lb) // 2
		if good(N, mid):
			ub = mid
		else:
			lb = mid
	return ub

def main():
	N = int(input())
	print(solve(N))
main()


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


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 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)
main()


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)


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 + 1) // 2:
		r_cl = m
	else:
		l_op = m
print(r_cl)


n = int(input())

def calc(n, k):
	ans = 0
	while n > 0:
		if n >= k:
			ans += k
			n -= k
		else:
			ans += n
			n = 0
		n -= n // 10
	return ans
lo = 1
hi = n
while lo < hi:
	md = (lo + hi) // 2
	if calc(n, md) * 2 >= n:
		hi = md
	else:
		lo = md + 1
print(lo)


from functools import reduce
import os
import sys
from collections import *
from decimal import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]

def Ceil(a, b):
	return a // b + int(a % b > 0)
albhabet = 'abcdefghijklmnopqrstuvwxyz'
mo = 1000000007
inf = 1e+18
div = 998244353

def check(val, n):
	sm = 0
	have = n
	flag = 0
	while have:
		res = min(have, val)
		sm += res
		have -= res
		have -= have // 10
	if sm >= Ceil(n, 2):
		flag = 1
	return flag
for _ in range(1):
	n = inn()
	(l, r) = (1, n)
	ans = -1
	while l <= r:
		mid = l + (r - l) // 2
		if check(mid, n):
			ans = mid
			r = mid - 1
		else:
			l = mid + 1
	print(ans)


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)


def cookiesConsumed(n, k):
	totalCount = 0
	while n > 0:
		vasya = min(k, n)
		totalCount += vasya
		n -= vasya
		n -= n // 10
	return totalCount
n = int(input())
target = (n + 1) // 2
l = 1
r = target
while r >= l:
	k = l + (r - l) // 2
	consumed = cookiesConsumed(n, k)
	if consumed == target:
		print(k)
		break
	if consumed < target:
		l = k + 1
	if consumed > target:
		r = k - 1
else:
	print(l)


n = int(input())

def func(k):
	v = 0
	p = 0
	num = n
	while num > 0:
		if num <= k:
			v += num
			num = 0
		else:
			v += k
			num -= k
			p += int(num // 10)
			num -= int(num // 10)
	return (v, p)
start = 1
end = n
res = 10 ** 20 + 7
while start <= end:
	mid = start + (-start + end) // 2
	(v, p) = func(mid)
	if v >= p:
		res = min(mid, res)
		end = mid - 1
	else:
		start = mid + 1
print(res)


def candies(total, k):
	vasya = 0
	while total > 0:
		vasya += min([k, total])
		total -= k
		total -= total // 10
	return vasya
n = int(input())
minCandies = n // 2 + n % 2
l = 1
r = n
res = 1
while l <= r:
	m = (l + r) // 2
	if candies(n, m) >= minCandies:
		if m == 1 or candies(n, m - 1) < minCandies:
			res = m
			break
		else:
			r = m - 1
	else:
		l = m + 1
print(res)


def can(n, k):
	total = n
	s = 0
	while n > 0:
		cur = min(n, k)
		s += cur
		n -= cur
		n -= n // 10
	return s * 2 >= total
n = int(input())
le = 0
rg = n
while rg - le > 1:
	mid = (rg + le) // 2
	if can(n, mid):
		rg = mid
	else:
		le = mid
print(rg)


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 = 0
while r - l > 1:
	c = (r + l) // 2
	if getans(n, c) * 2 >= n:
		r = c
	else:
		l = c
print(r)


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
sys.setrecursionlimit(1000000000)

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

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()))

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)}

def sortId(arr):
	return sorted(range(arr), key=lambda k: arr[k])

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
(n,) = ni()

def check(k):
	v = 0
	p = 0
	x = n
	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
	return v >= p

def bsearch(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)
print(x)


import sys
input = sys.stdin.readline
output = sys.stdout.write
n = int(input())

def f(k, n):
	kol = 0
	while n > 0:
		if n <= k:
			kol += n
			n = 0
		else:
			n -= k
			n -= n // 10
			kol += k
	return kol
lef = 0
rig = n
while lef + 1 < rig:
	mid = (lef + rig) // 2
	if f(mid, n) >= n // 2:
		rig = mid
	else:
		lef = mid
if f(rig, n) >= n - f(rig, n):
	print(rig)
else:
	print(rig + 1)


from decimal import Decimal

def checker(am):
	ans = 0
	cur_n = n
	while cur_n > 0:
		if cur_n >= am:
			cur_n -= am
			ans += am
		else:
			ans += cur_n
			cur_n = 0
		cur_n -= cur_n // 10
	if ans * 2 >= n:
		return True
	else:
		return False
n = int(input())
l = 0
r = n
while l + 1 < r:
	m = (l + r) // 2
	if checker(m):
		r = m
	else:
		l = m
print(r)


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)


n = int(input())
(l, r) = (1, n)
while l < r:
	k = (r + l) // 2
	cnt = 0
	m = n
	while m > 0:
		cnt += min(k, m)
		m -= min(k, m)
		m = m - m // 10
	if cnt >= (n + 1) // 2:
		r = k
	else:
		l = k + 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)


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())


def findval(val, n):
	cnt1 = 0
	cnt2 = 0
	m = n
	while m > 0:
		if val > m:
			cnt1 += m
			m = 0
		else:
			cnt1 += val
			m -= val
		if m > 0:
			cnt2 += m // 10
			m = m - m // 10
	if cnt1 >= cnt2:
		return 1
	else:
		return 0

def find(low, high, n):
	mid = (low + high) // 2
	if mid == 1:
		return mid
	val1 = findval(mid, n)
	if val1 == 1 and findval(mid - 1, n) == 0:
		return mid
	elif val1 == 1:
		return find(low, mid, n)
	else:
		return find(mid + 1, high, n)
n = int(input())
print(find(1, n, n))


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(n)


from math import ceil

def find_n(k):
	ev = n
	od = ev - k
	ev = od - od // 10
	c = 0
	while 1:
		c += 1
		od = ev - k
		if od < 0:
			return (c - 1 + 1) * k + ev
		ev = od - od // 10
n = int(input())
a = 1
b = n // 2 + 1
while a <= b:
	k = (a + b) // 2
	if find_n(k) >= (n + 1) // 2:
		b = k - 1
		answer = k
	else:
		a = k + 1
print(answer)


n = int(input())

def check(m):
	s = n
	(v, p) = (0, 0)
	while True:
		if s <= m:
			v += s
			break
		s -= m
		v += m
		p += s // 10
		s -= s // 10
		if p > n // 2:
			return False
	return v >= p
(low, high) = (1, n)
while low <= high:
	mid = (low + high) // 2
	if check(mid):
		high = mid - 1
	else:
		low = mid + 1
print(low)


n = int(input())
l = 1
r = n
ans = 0

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


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 Check(n, mid):
	S1 = 0
	while n > 0:
		if n < mid:
			S1 += n
			n = 0
		else:
			S1 += mid
			n -= mid
			n -= n // 10
	return S1
n = int(input())
l = 0
r = n
while l < r - 1:
	mid = (l + r) // 2
	if Check(n, mid) >= (n + 1) // 2:
		r = mid
	else:
		l = mid
print(r)


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)


n = int(input().strip())
l = 1
r = n
while l < r:
	flag = False
	mid = (l + r) // 2
	s = n
	a = 0
	b = 0
	while s:
		if s > mid:
			s -= mid
			a += mid
		else:
			a += s
			s = 0
		if s >= 10:
			t = s // 10
			b += t
			s -= t
		if a >= b:
			flag = True
			break
	if flag:
		r = mid
	else:
		l = mid + 1
print(l)


n = int(input())

def check(k):
	(a, b) = (0, 0)
	i = n
	while i > 0:
		t = min(k, i)
		a += t
		i -= t
		t = i // 10
		b += t
		i -= t
	return a >= b
left = 1
right = n
while right - left > 1:
	m = (left + right) // 2
	if check(m):
		right = m
	else:
		left = m
print(left if check(left) else right)


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())))


def check(n, k):
	sum = 0
	b = n
	while b != 0:
		sum += min(b, k)
		b -= min(b, k)
		b -= b // 10
	return sum * 2 >= n
n = int(input())
l = 1
r = n
eat = 0
while l <= r:
	mid = (l + r) // 2
	if check(n, mid):
		r = mid - 1
		eat = mid
	else:
		l = mid + 1
print(eat)


from sys import *
from math import *
from bisect import *
n = int(stdin.readline())

def fun(x, n):
	cnt = 0
	while n > 0:
		cnt += min(x, n)
		n -= x
		n -= n // 10
	return cnt
l = 0
h = n
ans = 0
j = n // 2
if n % 2 == 1:
	j += 1
while l <= h:
	m = (l + h) // 2
	k = n
	if m != 0:
		if fun(m, k) >= j:
			h = m - 1
			ans = m
		else:
			l = m + 1
	else:
		l = m + 1
print(ans)


n = int(input())

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


import re
import sys
exit = sys.exit
from bisect import bisect_left as bsl, bisect_right as bsr
from collections import Counter, defaultdict as ddict, deque
from functools import lru_cache
cache = lru_cache(None)
from heapq import *
from itertools import *
from math import inf
from pprint import pprint as pp
enum = enumerate
ri = lambda : int(rln())
ris = lambda : list(map(int, rfs()))
rln = sys.stdin.readline
rl = lambda : rln().rstrip('\n')
rfs = lambda : rln().split()
cat = ''.join
catn = '\n'.join
mod = 1000000007
d4 = [(0, -1), (1, 0), (0, 1), (-1, 0)]
d8 = [(-1, -1), (0, -1), (1, -1), (-1, 0), (1, 0), (-1, 1), (0, 1), (1, 1)]

def good(k):
	eaten = 0
	have = n
	while have > 0:
		eaten += min(k, have)
		have -= k
		have -= have // 10
	return 2 * eaten >= n
n = ri()
ans = n
(lo, hi) = (1, n)
while lo < hi:
	mid = lo + hi >> 1
	if good(mid):
		ans = hi = mid
	else:
		lo = mid + 1
print(ans)


import math
n = int(input())

def eat(k):
	vasya = petya = 0
	candy = n
	while candy > 0:
		ate = 0
		ate = min(candy, k)
		vasya += ate
		candy -= ate
		if candy > 9:
			ate = candy // 10
			petya += ate
			candy -= ate
	return vasya >= petya
l = int(math.log(n, 2))
a = 0
while l >= 0:
	b = 1 << l
	c = n - a - b
	if c > 0 and eat(c):
		a += b
	l -= 1
print(n - a)


import sys

def check(n, k):
	parity = 0
	count1 = 0
	count2 = 0
	while n > 0:
		if parity % 2 == 0:
			x = min(n, k)
			n -= x
			count1 += x
		else:
			y = n // 10
			count2 += y
			n -= y
		parity += 1
	if count1 >= count2:
		return True
	else:
		return False
n = input()
n = int(n)
left = 1
right = n
while left < right:
	mid = (left + right) // 2
	if check(n, mid):
		right = mid
	else:
		left = mid + 1
print(left)


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)


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 2 * s >= last
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))


n = int(input())
(lo, hi) = (1, n)

def solve(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
	if solve(n, mid) * 2 >= n:
		hi = mid
	else:
		lo = mid + 1
print(lo)


def main():
	N = int(input())
	(left, right, x, k, a) = (1, N, 1, 0, 0)
	while right >= left:
		n = N
		x = (left + right) // 2
		a = 0
		while 1:
			if n < x:
				a += n
				break
			a += x
			n -= x
			n -= n // 10
		if a >= (N + 1) // 2:
			k = x
			right = x - 1
		else:
			left = x + 1
	print(k)
main()


from sys import stdin
n = int(stdin.readline())
cn = n // 2 + n % 2
l = 1
r = n
while l < r:
	mid = (l + r) // 2
	cur = n
	vas = 0
	while cur > 0:
		w = min(cur, mid)
		vas += w
		cur -= w
		cur -= cur // 10
	if vas < cn:
		l = mid + 1
	else:
		r = mid
print(r)


def f(ec, k):
	if k == 0:
		return 0
	s = 0
	while ec >= k:
		ec = ec - k
		s += k
		ec = ec - ec // 10
	if ec > 0:
		s += ec
	return s

def h(n):
	l = 0
	r = n
	ost = n // 2
	if n % 2 != 0:
		ost += 1
	k = (l + r) // 2
	while l < k < r:
		if f(n, k) > ost:
			r = k
		elif f(n, k) < ost:
			l = k
		else:
			return k
		k = (l + r) // 2
	if f(n, l) >= ost:
		return l
	return r
n = int(input())
print(h(n))


def solve(n, k):
	sum = 0
	maxx = n
	while maxx > 0:
		c = min(maxx, k)
		sum += c
		maxx -= c
		maxx -= maxx // 10
	return 2 * sum >= n

def binarySearch(l, r):
	ans = r
	while l <= r:
		k = (r + l) // 2
		if solve(n, k):
			ans = k
			r = k - 1
		else:
			l = k + 1
	return ans
n = int(input())
print(binarySearch(1, n))


def f(n, k):
	summ = 0
	while n >= k:
		n -= k
		summ += k
		if n >= 10:
			n -= n // 10
	return summ + n
n = int(input())
(left, right) = (0, n + 1)
while left < right - 1:
	mid = (left + right) // 2
	if f(n, mid) >= (n + 1) // 2:
		right = mid
	else:
		left = mid
print(right)


n = int(input())
const = n
l = 0
r = n
while r - l > 1:
	n = const
	ans = (r + l) // 2
	x = 0
	while n > 0:
		x += min(n, ans)
		n -= min(n, ans)
		n -= n // 10
	if x >= (const + 1) // 2:
		r = ans
	else:
		l = ans
print(r)


n = int(input())
(l, r) = (0, int(1e+18) + 1)
k = -1
while l < r - 1:
	sm = 0
	cur = n
	k = (l + r) // 2
	while cur > 0:
		c = min(cur, k)
		sm += c
		cur -= c
		cur -= cur // 10
	if 2 * sm >= n:
		r = k
	else:
		l = k
print(r)


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()]

def canEat(k):
	rem = n
	eaten = 0
	while rem > 0:
		eat = min(k, rem)
		rem -= eat
		rem -= rem // 10
		eaten += eat
	return eaten * 2 >= n
n = Int()
low = 1
high = n + 1
while low <= high:
	mid = (low + high) // 2
	if canEat(mid):
		ans = mid
		high = mid - 1
	else:
		low = mid + 1
print(ans)


candies = int(input())
r = candies
l = 1
while r > l:
	meio = (r + l) // 2
	aux_candies = candies
	cool = 0
	while aux_candies > 0:
		comeu = min(aux_candies, meio)
		aux_candies -= comeu
		cool += comeu
		aux_candies -= aux_candies // 10
	if (candies + 1) // 2 <= cool:
		r = meio
	else:
		l = meio + 1
print(r)


def vasya(n, k):
	number = 0
	while n > 0:
		if n < k:
			number += n
			n = 0
			break
		n = n - k
		n = n - n // 10
		number += k
	return number

def find(n):
	l = 1
	r = n
	while l < r:
		mid = (l + r) // 2
		if vasya(n, mid) >= (n + 1) // 2:
			r = mid
		else:
			l = mid + 1
	return l
n = int(input())
print(find(n))


def check(mid_k, n):
	vasya_sum = 0
	total_candies = n
	while total_candies >= 1:
		choice = min(total_candies, mid_k)
		vasya_sum += choice
		total_candies -= choice
		total_candies -= total_candies // 10
	if vasya_sum * 2 >= n:
		return 1
	else:
		return 0
for _ in range(1):
	n = int(input())
	k = 1
	start = 1
	end = n
	while start <= end:
		mid_k = start + (end - start) // 2
		if check(mid_k, n):
			k = mid_k
			end = mid_k - 1
		else:
			start = mid_k + 1
	print(k)


import collections
from functools import cmp_to_key
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)


import sys
input = sys.stdin.readline

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

def main():
	n = int(input())
	st = 1
	nd = n
	ans = n
	while st <= nd:
		mid = (st + nd) // 2
		if f(n, mid):
			ans = mid
			nd = mid - 1
		else:
			st = mid + 1
	print(ans)
main()


n = int(input())
l = 0
r = n

def test(k):
	m = n
	tot = 0
	while m > 0:
		tot += min(m, k)
		m -= min(m, k)
		m -= m // 10
	return tot * 2 >= n
while r - l > 1:
	k = r + l >> 1
	if test(k):
		r = k
	else:
		l = k
print(r)


def good_combination(n, k):
	orig = n
	count = 0
	while n > 0:
		count += min(k, n)
		n -= k
		n -= n // 10
	return count * 2 >= orig

def solve(n):
	l = 1
	r = n
	while r - l > 1:
		mid = (r + l) // 2
		if good_combination(n, mid):
			r = mid
		else:
			l = mid + 1
	return l if good_combination(n, l) else r
print(solve(int(input().strip())))


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())

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)
elif check(l, n):
	print(l)
else:
	print(r)


import sys
import math

def finish(n, k):
	res = 0
	while n:
		eaten = min(n, k)
		res += eaten
		n -= eaten
		n -= n // 10
	return res
n = int(input())
lo = 1
high = (n + 1) // 2
while lo != high:
	mid = (lo + high) // 2
	if finish(n, mid) * 2 >= n:
		high = mid
	else:
		lo = mid + 1
print(lo)


def f(n, k):
	vasya = 0
	total = n
	while n > 0:
		m = min(k, n)
		n -= m
		vasya += m
		n -= n // 10
	if 2 * vasya >= total:
		return True
	else:
		return False
n = int(input())
lo = 1
hi = n
while lo < hi:
	mid = (lo + hi) // 2
	if f(n, mid):
		hi = mid
	else:
		lo = mid + 1
print(hi)


def paramin(F, l, r):
	while l <= r:
		mid = (l + r) // 2
		if F(mid):
			(ans, r) = (mid, mid - 1)
		else:
			l = mid + 1
	return ans

def half(x):
	n = am
	vasya = 0
	while n:
		take = min(x, n)
		n -= take
		vasya += take
		n -= n // 10
	return vasya * 2 >= am
am = int(input())
print(paramin(half, 1, am))


def check(k, n):
	tot = 0
	cur = n
	while cur > 0:
		o = min(cur, k)
		tot += o
		cur -= o
		cur -= cur // 10
	return tot * 2 >= n
n = int(input())
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)


def min_candies(n):
	target = (n + 1) // 2
	left = 1
	right = n
	current_min_chunk = float('inf')
	while right > left:
		k = (left + right) // 2
		candies_left = n
		total_eaten = 0
		while candies_left:
			if candies_left > k:
				candies_left -= k
				total_eaten += k
			else:
				total_eaten += candies_left
				candies_left = 0
			candies_left = candies_left - candies_left // 10
		if total_eaten >= target:
			current_min_chunk = min(current_min_chunk, k)
			right = k
		else:
			left = k + 1
	return left
n = int(input())
print(min_candies(n))


def candy(caixa, k):
	balas_varzya = 0
	n = caixa
	while n > 0:
		mordida = min(k, n)
		n -= mordida
		balas_varzya += mordida
		n -= n // 10
	if 2 * balas_varzya >= caixa:
		return True
	else:
		return False
stock = input()
stock = int(stock)
ini = 1
fin = stock
while fin > ini:
	mid = (ini + fin) // 2
	if candy(stock, mid):
		fin = mid
	else:
		ini = mid + 1
print(ini)


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):
		high = mid - 1
	else:
		low = mid + 1
if not check(n, mid):
	mid += 1
print(mid)


def check(n, k):
	r = n + 1 >> 1
	while n > 0:
		p = min(n, k)
		r -= p
		n -= p
		n -= n // 10
	return r <= 0
n = int(input())
(l, r) = (1, n)
while l < r:
	m = l + r >> 1
	if check(n, m):
		r = m
	else:
		l = m + 1
print(l)


n = int(input())
l = 0
r = n

def eats(n, k):
	res = 0
	while n > 0:
		if n < k:
			res += n
			n = 0
		else:
			res += k
			n -= k
			n -= n // 10
	return res
while r - l > 1:
	mid = (r + l) // 2
	if eats(n, mid) >= (n + 1) // 2:
		r = mid
	else:
		l = mid
print(r)


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
	if check(n, mid):
		r = mid - 1
	else:
		l = mid + 1
print(l)


from collections import Counter
n = int(input())

def check(k):
	start = n
	a = 0
	b = 0
	while start > 0:
		a += min(k, start)
		start = max(0, start - k)
		b += start // 10
		start -= start // 10
	return a >= b
left = 1
right = n
while right - left > 1:
	mid = (left + right) // 2
	if check(mid):
		right = mid
	else:
		left = mid
if check(left):
	print(left)
else:
	print(right)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
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)
		while n > 0:
			v += min(m, n)
			n -= m
			if n >= 10:
				p += n // 10
			n -= n // 10
		return v >= p
	while l < r:
		mid = (l + r) // 2
		if check(mid, n):
			r = mid
		else:
			l = mid + 1
	print(l)
main()


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())
(l, r) = (1, n)
while l < r:
	m = (l + r) // 2
	cur = n
	k = m
	p = 0
	v = 0
	while cur:
		v += min(cur, k)
		cur -= min(cur, k)
		p += cur // 10
		cur -= cur // 10
	if v >= (n + 1) // 2:
		r = m
	else:
		l = m + 1
print(l)


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)


import sys
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(1):
	n = int(input())
	l = 1
	r = n
	ans = 2 ** 100
	while l <= r:
		m = l + (r - l) // 2
		c = 0
		cand = n
		while cand > 0:
			temp = min(m, cand)
			cand -= temp
			c += temp
			cand -= cand // 10
		if c * 2 >= n:
			ans = min(ans, m)
			r = m - 1
		else:
			l = m + 1
	print(ans)


import math
from decimal import Decimal
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
mid = n
ans = mid
while r - l >= 0:
	mid = (r + l) // 2
	if sim(n, mid) >= Decimal(n) / 2:
		r = mid - 1
		ans = mid
	if sim(n, mid) < Decimal(n) / 2:
		l = mid + 1
print(ans)


import configparser
import sys
input = sys.stdin.readline

def ceil_div(x, y):
	return -(-x // y)

def can(k, n):
	if k == 0:
		return False
	org = n
	i = 0
	while n > 0:
		take_off = min(n, k)
		n -= take_off
		i += take_off
		n -= n // 10
	return i >= ceil_div(org, 2)

def main():
	n = int(input())
	pos = -1
	for i in range(70, -1, -1):
		jump = 1 << i
		if not can(pos + jump, n):
			pos += jump
	print(pos + 1)
main()


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)
main()


n = int(input())

def calculate(n, k):
	suma = 0
	sumb = 0
	while True:
		if n < k:
			suma += n
			break
		else:
			n -= k
			suma += k
			sumb += n // 10
			n -= n // 10
	return suma >= sumb
a = n
b = 0
while a - b != 1:
	k = (a + b) // 2
	if calculate(n, k) == True:
		a = k
	else:
		b = k
print(a)


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)


from sys import stdin, stdout
from math import ceil
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))

def fn(k):
	sm = 0
	left = n
	while left > 0:
		sm += min(k, left)
		left -= min(k, left)
		left -= left // 10
	return sm * 2 >= n
for _ in range(1):
	n = nmbr()
	l = 1
	r = n
	while l <= r:
		mid = l + r >> 1
		if fn(mid) == False:
			l = mid + 1
		else:
			r = mid - 1
	print(l)


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())

def check(p):
	V = 0
	n_ = n
	while n_ > 0:
		temp = min(n_, p)
		V += temp
		n_ -= temp
		n_ -= n_ // 10
	return 2 * V >= n

def binSearch(a, b):
	(left, right) = (a - 1, b + 1)
	while right - left > 1:
		mid = (left + right) // 2
		if check(mid):
			right = mid
		else:
			left = mid
	return right
print(binSearch(1, n // 2))


from bisect import bisect_left

def searchCandies(a):
	(l, h, m, ans) = (1, a, 0, 1)
	while l <= h:
		(m, s) = (l + (h - l) // 2, 0)
		(k, p, v) = (a, 0, 0)
		while k > 0:
			if k - m >= 0:
				v += m
				k -= m
			else:
				v += k
				k -= k
			if k < 10:
				pass
			else:
				p += k // 10
				k -= k // 10
		if v >= p:
			ans = m
			h = m - 1
		else:
			l = m + 1
	return ans

def main():
	print(searchCandies(int(input())))
main()


def candy(k, n, half):
	eaten = 0
	firstVEat = min(k, n)
	eaten += firstVEat
	n -= firstVEat
	while n > 9:
		pEat = n // 10
		n -= pEat
		vEat = min(k, n)
		eaten += vEat
		n -= vEat
	eaten += n
	return eaten >= half

def candysearch(n, half):
	s = 0
	e = n
	while s + 1 < e:
		mid = (s + e + 1) // 2
		if candy(mid, n, half):
			e = mid
		else:
			s = mid
	print(e)
n = int(input())
candysearch(n, (n + 1) // 2)


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve(mid, n):
	c = d = 0
	candies = n
	while candies >= mid:
		c += mid
		candies -= mid
		d += candies // 10
		candies = candies - candies // 10
	c += candies
	half = n // 2 + n % 2
	if c >= half:
		return True
	return False

def case():
	n = I()
	(l, r) = (1, n // 2 + n % 2)
	m = n
	while l <= r:
		mid = (l + r) // 2
		if solve(mid, n):
			r = mid - 1
			m = mid
		else:
			l = mid + 1
	print(m)
for _ in range(1):
	case()


def good2(n, k):
	orig_n = n
	v = 0
	while n > 0:
		to_eat = min(k, n)
		n -= to_eat
		v += to_eat
		n -= n // 10
	assert n == 0
	return 2 * v >= orig_n
n = int(input())

def good(k):
	return good2(n, k)
lo = 1
hi = 1
while not good(hi):
	lo = hi + 1
	hi *= 2
best_so_far = hi
while lo <= hi:
	mid = (lo + hi) // 2
	if good(mid):
		best_so_far = mid
		hi = mid - 1
	else:
		lo = mid + 1
print(best_so_far)


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 verificar(n, k):
	if k <= 0:
		return False
	limite = n // 2 + n % 2
	comidos = 0
	while n > 0:
		if n <= k:
			comidos += n
			break
		n -= k
		comidos += k
		n -= n // 10
	return comidos >= limite

def bs(n):
	b = 1000000000000000000
	a = 0
	meio = (b + a) // 2
	while a <= b:
		if verificar(n, meio):
			b = meio - 1
		else:
			a = meio + 1
		meio = (b + a) // 2
	return a
n = int(input())
print(bs(n))


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


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)


n = int(input())

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


import math

def checkValid(n, k):
	half = n // 2 + n % 2
	candies = 0
	while n > 0:
		n -= k
		if n < 0:
			candies += n + k
			break
		n -= n // 10
		candies += k
	return candies >= half

def compute(n):
	hi = n // 4 + n % 4
	lo = 1
	res = hi
	while hi > lo:
		mid = (hi + lo) // 2
		if checkValid(n, mid):
			res = mid
			hi = mid - 1
		else:
			lo = mid + 1
	if hi == lo and checkValid(n, hi):
		res = hi
	return res
n = int(input())
print(compute(n))


def main():
	n = int(input())
	low = 1
	high = n
	ans = n
	while low <= high:
		k = (low + high) // 2
		count = 0
		m = n
		while m >= k:
			m -= k
			count += k
			if m > 0:
				m -= m // 10
		count += m
		if count * 2 >= n:
			ans = k
			high = k - 1
		else:
			low = k + 1
	print(ans)
main()


N = int(input())

def eat(p):
	sum = 0
	t = N
	while t > 0:
		dec = min(p, t)
		t -= dec
		t -= t // 10
		sum += dec
	return True if sum >= (N + 1) // 2 else False
if N <= 42:
	print(1)
else:
	low = 0
	high = N
	while low <= high:
		mid = (low + high) // 2
		if eat(mid) is True:
			high = mid - 1
		else:
			low = mid + 1
	print(low)


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)


n = int(input())

def che(k):
	nn = n
	cnt = 0
	while nn:
		if nn <= k:
			cnt += nn
			break
		cnt += k
		nn -= k
		nn -= nn // 10
	return cnt << 1 >= n
(l, r) = (1, 1000000000000000000)
while l < r:
	mid = l + r >> 1
	if che(mid):
		r = mid
	else:
		l = mid + 1
print(r)


n = int(input())

def check(absolute):
	ans = 0
	remain = n
	while remain:
		ans += min(remain, absolute)
		remain -= min(remain, absolute)
		remain -= remain // 10
	return 2 * ans >= n
lower = 1
upper = n
while lower < upper:
	guess = (lower + upper) // 2
	if check(guess):
		upper = guess
	else:
		lower = guess + 1
print(upper)


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)


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 * 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(start(int(input())))


total = int(input())
if total < 20:
	print(1)
else:
	k = (total // 10 + 1) // 2
	posRange = (1, total // 10)
	while posRange[0] != posRange[1]:
		vnum = 0
		left = total
		while left > 0:
			if left <= k:
				vnum += left
				left = 0
			elif left < 10:
				vnum += k
				left -= k
			else:
				vnum += k
				left -= k
				left = left - left // 10
		if vnum >= (total + 1) // 2:
			posRange = (posRange[0], k)
		else:
			posRange = (k + 1, posRange[1])
		k = (posRange[0] + posRange[1]) // 2
	print(posRange[0])


n = int(input())

def eat(n, k):
	first = 0
	old = n
	while n > 0:
		if n > k:
			n -= k
			first += k
		else:
			first += n
			n = 0
		n -= n // 10
	if 2 * first >= old:
		return True
	return False
r = n + 1
l = 1
while l + 1 < r:
	m = l + (r - l - 1) // 2
	if eat(n, m):
		r = m + 1
	else:
		l = m + 1
print(l)


import math
n = int(input())

def test(k):
	r = n
	st = 0
	while r > 0:
		r -= k
		if r >= 10:
			st1 = r // 10
			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 + n % 2:
			a = mid
		else:
			b = mid
	print(b)
else:
	print(a)


def consumed(n, k):
	res = 0
	while n:
		eaten = min(n, k)
		res += eaten
		n -= eaten
		n -= n // 10
	return res
n = int(input())
lo = 1
high = (n + 1) // 2
while lo != high:
	mid = (lo + high) // 2
	if consumed(n, mid) * 2 >= n:
		high = mid
	else:
		lo = mid + 1
print(lo)


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()
	print(slv(N))
main()


def f(n, k):
	m = n
	(p, v) = (0, 0)
	while n > 0:
		p += min(k, n)
		n -= min(n, k)
		if p >= m // 2:
			break
		v += n // 10
		n -= n // 10
		if v > m // 2:
			break
	return p >= v
n = int(input())
(l, u) = (1, n)
while l != u:
	m = (l + u) // 2
	if not f(n, l) and (not f(n, m)):
		l = m + 1
	elif f(n, m) and f(n, u):
		u = m
print(l)


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)


N = int(input())

def check(k):
	r = N
	a = 0
	while 1:
		if r < k:
			a += r
			break
		r -= k
		a += k
		r -= r // 10
	return a * 2 >= N
left = 0
right = 10 ** 18 + 1
while left + 1 < right:
	mid = (left + right) // 2
	if check(mid):
		right = mid
	else:
		left = mid
print(right)


def check(k, n):
	(now, eat, eatk) = (n, k, 0)
	while now >= 10:
		now -= eat
		if now > 0:
			now -= now // 10
		eatk += 1
	return 2 * (eatk * k + now) >= n
n = int(input())
(ans, l, r) = (n, 1, n)
while l <= r:
	c = (l + r) // 2
	if check(c, n):
		ans = c
		r = c - 1
	else:
		l = c + 1
print(ans)


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))


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))


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:
			v += last
			last = 0
		p += last // 10
		last -= last // 10
	if v >= p:
		return True
	else:
		return False
left = 0
right = n
while right - left > 1:
	middle = (right + left) // 2
	if f(middle) == False:
		left = middle
	else:
		right = middle
print(right)


import sys
import bisect
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
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 check(m, k):
	lest = m // 2 + m % 2
	n = m
	got = 0
	while n:
		if n >= k:
			n -= k
			got += k
		else:
			got += n
			n = 0
		n -= n // 10
	if got >= lest:
		return 1
	return 0
n = int(input())
if 1:
	l = 1
	h = 10000000000000000000
	while h - l > 1:
		mid = (l + h) // 2
		z = check(n, mid)
		if z == 1:
			h = mid
		else:
			l = mid
	if check(n, l):
		print(l)
	else:
		print(h)


def greater(nowcandy, x):
	vas = int(0)
	pet = int(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)
	if vas >= pet:
		return True
	else:
		return False
candies = int(input())
lo = int(1)
hi = int(candies)
while lo < hi:
	mid = int((lo + hi) // 2)
	if greater(candies, mid):
		hi = mid
	else:
		lo = mid + 1
print(lo)


def func(n, k):
	v = 0
	p = 0
	while n > 0:
		v += min(k, n)
		n = max(n - k, 0)
		p += n // 10
		n -= n // 10
	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)


import sys

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

def binS(begin, end, n):
	mid = (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:
	p = int(pow(n, 0.5))
	print(binS(0, int(n / 2), n))


def check(x):
	amount = n
	s = 0
	while amount > 0:
		amount -= x
		s += x
		if amount < 0:
			s -= abs(amount)
			break
		amount -= amount // 10
	if s >= n - s:
		return True
	else:
		return False

def binarysearch(p, q):
	if q - p < 1:
		print(p)
		return
	mid = (p + q) // 2
	if check(mid):
		binarysearch(p, mid)
	else:
		binarysearch(mid + 1, q)
n = int(input())
binarysearch(1, n // 2 + 1)


def candies():
	initial_candies = int(input())
	left = 0
	right = initial_candies
	counter = 0
	while left != right:
		mid = (left + right) // 2
		if vasya_eats_half(initial_candies, mid):
			right = mid
		else:
			left = mid + 1
	print(left)

def vasya_eats_half(total, k):
	if k == 0:
		return False
	vasya = 0
	petya = 0
	while total > 0:
		if k > total:
			vasya += total
			total = 0
		if k <= total:
			vasya += k
			total -= k
		ten_percent = total // 10
		if ten_percent > total:
			petya += total
			total = 0
		if ten_percent <= total:
			petya += ten_percent
			total -= ten_percent
	if vasya >= petya:
		return True
	else:
		return False
candies()


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)


import math
from decimal import Decimal
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(Decimal(n) / 2):
		break
	if sim(n, mid) > Decimal(n) / 2:
		r = mid - 1
	if sim(n, mid) < Decimal(n) / 2:
		l = mid + 1
if sim(n, mid) < Decimal(n) / 2:
	while sim(n, mid) < Decimal(n) / 2:
		mid += 1
	print(mid)
elif sim(n, mid) > Decimal(n) / 2:
	if mid == 1:
		print(mid)
	else:
		while sim(n, mid) >= Decimal(n) / 2:
			mid -= 1
		print(mid + 1)
else:
	print(mid)


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
import math

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 divs(n, start=2):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors
import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())
import sys
from bisect import bisect_left
import sys

def can(x):
	cur = n
	su = 0
	while cur:
		val = min(x, cur)
		su += val
		cur -= val
		cur -= cur // 10
	return 2 * su >= n
n = int(sys.stdin.readline())
l = 1
r = n
while l <= r:
	mid = (l + r) // 2
	if can(mid):
		ans = mid
		r = mid - 1
	else:
		l = mid + 1
print(ans)


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 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
while l <= r:
	m = (l + r) // 2
	if check(n, m):
		r = m - 1
	else:
		l = m + 1
print(l)


import math

def calculate_amount(n, k):
	s = 0
	while n:
		if n <= k:
			s = s + n
			break
		else:
			n -= k
			s += k
			n -= n // 10
	return s

def getmin(n):
	l = 1
	r = n
	while l < r:
		m = (l + r) // 2
		if calculate_amount(n, m) >= (n + 1) // 2:
			r = m
		else:
			l = m + 1
	return l
num = int(input())
print(getmin(num))


def solve(total, k):
	v_cnt = 0
	copy_total = total
	while True:
		if total == 0:
			break
		if total <= k:
			v_cnt += total
			break
		v_cnt += k
		total = total - k
		total = total - total // 10
	if (copy_total + 1) // 2 <= v_cnt:
		return True
	else:
		return False
total = int(input())
left = 1
if solve(total, left) == True:
	right = 1
else:
	right = total
	while True:
		if left + 1 == right:
			break
		mid = (left + right) // 2
		res = solve(total, mid)
		if res == True:
			right = mid
		else:
			left = mid
print(right)


n = int(input())

def can(k):
	cur = n
	s = 0
	while cur > 0:
		eat = min(k, cur)
		s += eat
		cur -= eat
		cur -= cur // 10
	return 2 * s >= n
(left, right) = (0, n)
while left + 1 < right:
	mid = left + right >> 1
	if not can(mid):
		left = mid
	else:
		right = mid
print(right)


def eat(n, k):
	v = 0
	p = 0
	m = n
	while n > k:
		v = v + k
		n = n - k
		p = p + n // 10
		n = n - n // 10
	v = v + n
	if v >= (m + 1) // 2:
		return 1
	else:
		return 0

def binarysearch(n):
	l = 1
	h = n
	a = []
	while l <= h:
		mid = (l + h) // 2
		t = eat(n, mid)
		if t == 1:
			a.append(mid)
			h = mid - 1
		if t == 0:
			l = mid + 1
	return min(a)
n = int(input())
print(binarysearch(n))


import math
n = int(input())

def helper(n, k):
	(summa, summb) = (0, 0)
	while n > 0:
		if n > k:
			summa += k
			n -= k
		else:
			summa += n
			break
		cur = n // 10
		summb += cur
		n -= cur
	return (summa, summb)
(l, r) = (1, n)
while l < r:
	mid = (l + r) // 2
	(summa, summb) = helper(n, mid)
	if summa >= summb:
		r = mid
	else:
		l = mid + 1
print(l)


n = int(input())
hi = 1000000000000000000
lo = 1
ans = -1
while lo <= hi:
	k = (hi + lo) // 2
	vas = 0
	c = n
	while c > 0:
		j = min(c, k)
		vas += j
		c -= j
		c -= c // 10
	if 2 * vas >= n:
		ans = k
		hi = k - 1
	else:
		lo = k + 1
print(ans)


n = int(input())

def bs(m, temp):
	vasya = 0
	while temp > 0:
		if temp <= m:
			vasya += temp
			break
		vasya += m
		temp -= m
		temp -= temp // 10
	if vasya * 2 >= n:
		return True
	else:
		return False
(lo, hi) = (1, n // 2 + 1)
while lo <= hi:
	m = (lo + hi) // 2
	if bs(m, n):
		ans = m
		hi = m - 1
	else:
		lo = m + 1
print(ans)


def process(n, k):
	cnt = 0
	while n > 9:
		x = min(n, k)
		n -= x
		cnt += x
		n -= n // 10
	return cnt + n
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)


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)


def check(num):
	(c1, c2) = (0, 0)
	m = n
	while m != 0:
		c1 += min(num, m)
		m -= min(num, m)
		c2 += m // 10
		m -= m // 10
	if c1 >= (n - 1) // 2 + 1:
		return True
	return False
n = int(input())
low = 1
high = n
while low < high:
	mid = (low + high) // 2
	if check(mid):
		high = mid - 1
	else:
		low = mid + 1
if check(low):
	print(low)
else:
	print(low + 1)


n = 0
n2 = 0

def fun(k):
	global n, n2
	if k <= 0:
		return 0
	ans = min(n, k)
	n3 = n - k
	n3 -= max(int(str(n3)[:-1]), 0.0)
	while n3 > 0:
		ans += min(k, n3)
		n3 -= k
		if n3 < 10:
			ans += max(0, n3)
			break
		n3 -= max(int(str(n3)[:-1]), 0.0)
	return int(ans)

def binSearchMin():
	global n, n2
	last = n
	first = 1
	mid = (last + first) // 2
	num = fun(mid)
	while last >= first:
		if num < n2:
			first = mid + 1
		elif num > n2:
			last = mid - 1
		else:
			return mid
		mid = (last + first) // 2
		num = fun(mid)
	if fun(first) == n2:
		return first
	return last
n = int(input())
if n < 10:
	print(1)
else:
	n2 = (n + 1) // 2
	num = binSearchMin()
	num -= 2000
	while fun(num) < n2:
		num += 1
	print(num)


from math import ceil

def fn(n, k):
	count = 0
	eaten_toffee = 0
	nc = n
	while n > 0:
		count += 1
		o = min(n, k)
		eaten_toffee += o
		n -= o
		n -= n // 10
	if eaten_toffee * 2 >= nc:
		return True
	return False
n = int(input())

def binary_search(lo, hi):
	while lo < hi:
		mid = lo + (hi - lo) // 2
		if fn(n, mid) == True:
			hi = mid
		else:
			lo = mid + 1
	return lo
print(binary_search(1, n))


def c(n, k):
	v = 0
	p = 0
	nn = n
	while n:
		v += min(n, k)
		n -= min(n, k)
		p += n // 10
		n -= n // 10
	if 2 * v >= nn:
		return True
	return False
n = int(input())
hi = n + 10
lo = 1
ans = 0
while lo <= hi:
	mid = (lo + hi) // 2
	if c(n, mid):
		res = mid
		hi = mid - 1
	else:
		lo = mid + 1
print(res)


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
	n = cp
	return a >= b
for i in range(500):
	mid = (lo + hi) // 2
	if check(mid):
		hi = mid
	else:
		lo = mid + 1
mid = (lo + hi + 1) // 2
print(mid)


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

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
print(solve())


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))


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


import sys
n = int(input())

def is_ok(sol):
	have = n
	v = p = 0
	while have > 0:
		v += min(have, sol)
		have -= min(have, sol)
		have -= have // 10
		if v >= n // 2 + n % 2:
			return True
	return v >= n // 2 + n % 2
step = 1
while step < n:
	step *= 2
sol = step
while step != 0:
	if sol - step > 0 and is_ok(sol - step):
		sol -= step
	step //= 2
print(sol)


def how_much_he_eats(n, k):
	result = 0
	while n != 0:
		eats = min([n, k])
		result += eats
		n -= eats
		n -= n // 10
	return result
n = int(input())
(a, b, c) = (1, n, 0)
while a < b:
	c = (a + b) // 2
	if 2 * how_much_he_eats(n, c) >= n:
		b = c
	else:
		a = c + 1
print(a)


n = int(input())

def f(k, n):
	ans = 0
	while n:
		ans += min(n, k)
		n -= min(n, k)
		n -= n // 10
	return ans
h = n // 2
l = 1
while l <= h:
	m = (l + h) // 2
	if f(m, n) == (n + 1) // 2:
		l = m
		break
	elif f(m, n) < (n + 1) // 2:
		l = m + 1
	else:
		h = m - 1
print(l)


from math import *

def cal(x):
	(tem, n1, n2) = (0, m, n)
	while n2 > 0 and tem < n1 and (x > 0):
		tem += min(x, n2)
		n2 -= min(x, n2)
		n2 -= n2 // 10
	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
	return en
n = int(input())
m = n // 2 + n % 2
print(bs(0, n, m))


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)


def calc():
	n = int(input())
	l = 1
	r = int(1e+18)
	ans = l

	def possible(k):
		(v, p) = [0, 0]
		tot = n
		while True:
			cur = min(tot, k)
			v += cur
			tot -= cur
			cur = tot // 10
			p += cur
			tot -= cur
			if tot == 0:
				break
		return v >= (n + 1) // 2
	while l <= r:
		m = (l + r) // 2
		if possible(m):
			ans = m
			r = m - 1
		else:
			l = m + 1
	print(ans)
calc()


n = int(input().strip())
vthrs = n - n // 2

def check(k):
	t = n
	ve = 0
	while t > 0 and ve < vthrs:
		ve += min(t, k)
		t -= min(t, k)
		t -= t // 10
	return ve >= vthrs
kmin = 1
kmax = 1
while not check(kmax):
	kmin = kmax
	kmax *= 2
while kmax - kmin > 1:
	kmid = (kmin + kmax) // 2
	if check(kmid):
		kmax = kmid
	else:
		kmin = kmid
print(kmax)


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)


def helper(k, numCandies):
	candiesLeft = numCandies
	v = 0
	while candiesLeft > 0:
		if candiesLeft < k:
			v += candiesLeft
			candiesLeft = 0
		else:
			v += k
			candiesLeft = candiesLeft - k - (candiesLeft - k) // 10
	if v >= (numCandies + 1) // 2:
		return 1
	else:
		return 0

def p3(numCandies):
	start = 1
	end = numCandies
	if numCandies <= 42:
		if numCandies == 41:
			return 2
		else:
			return 1
	while start <= end:
		mid = (end + start) // 2
		if helper(mid, numCandies) == 1:
			end = mid - 1
		else:
			start = mid + 1
	return start
n = int(input())
print(p3(n))


import sys
import decimal

def main():
	input_list = get_input()
	print(solve(int(input_list[0])))

def get_input():
	input_list = []
	for line in sys.stdin:
		input_list.append(line.rstrip('\n'))
	return input_list

def solve(n):
	return binary_search(n, 1, int(n // 2) + 1)

def p(n, k):
	total = 0
	n_tot = decimal.Decimal(n)
	while n > 0:
		if k >= n:
			total += n
			n = 0
			break
		n += -1 * k
		total += k
		n += -1 * (n // 10)
	return total >= n_tot / decimal.Decimal(2)

def binary_search(n, lower, upper):
	if lower > upper:
		return lower
	mid = lower + (upper - lower) // 2
	if p(n, mid) == True:
		return binary_search(n, lower, mid - 1)
	else:
		return binary_search(n, mid + 1, upper)
main()


def isAtLeastHalf(k, n):
	V = 0
	P = 0
	if n % 2 == 0:
		least = n // 2
	else:
		least = n // 2 + 1
	res = False
	while n > 0 and k > 0:
		if n >= k:
			V += k
			n -= k
		else:
			V += n
			n = 0
		temp = n // 10
		P += temp
		n -= temp
		if V >= least:
			res = True
			break
	return res

def searchMiniumCandies(n, l, r, res=-1):
	if r >= l:
		mid = l + (r - l) // 2
		if isAtLeastHalf(mid, n):
			res = mid
			return searchMiniumCandies(n, l, mid - 1, res)
		else:
			return searchMiniumCandies(n, mid + 1, r, res)
	else:
		return res
n = int(input())
print(searchMiniumCandies(n, 0, n))


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)


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def ceil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

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

def solve(n, temp):
	a = 0
	b = 0
	while n > 0:
		if n <= temp:
			a += n
			n = 0
			break
		else:
			n -= temp
			a += temp
		c = n // 10
		b += c
		n -= c
	return a >= b
n = int(input())
a = 1
b = n
ans = 0
while a <= b:
	k = (a + b) // 2
	if solve(n, k):
		ans = k
		b = k - 1
	else:
		a = k + 1
print(ans)


noc = int(input())
(l, r) = (1, noc)
while l < r:
	mid = (l + r) // 2
	(a, b, c) = (0, 0, noc)
	while c:
		d = min(c, mid)
		a += d
		c -= d
		b += c // 10
		c -= c // 10
	if a < b:
		l = mid + 1
	else:
		r = mid
print(l)


def bs(l, h):
	while l < h:
		m = (l + h) // 2
		if gf(m):
			h = m
		else:
			l = m + 1
	return l

def gf(k):
	p = t
	c = 0
	while p > 0:
		c += min(p, k)
		p -= min(p, k)
		p -= p // 10
	return c >= (t + 1) // 2
t = int(input())
print(bs(1, (t + 1) // 2))


import sys
import math
import bisect

def query_value(n, m):
	ans = 0
	tmp = n
	while n:
		if n <= m:
			ans += n
			n = 0
		else:
			ans += m
			n -= m
		n -= n // 10
	return ans

def solve(n):
	left = 1
	right = n
	if query_value(n, left) * 2 >= n:
		return left
	while right - left > 1:
		mid = (left + right) // 2
		if query_value(n, mid) * 2 >= n:
			right = mid
		else:
			left = mid
	return right

def main():
	n = int(input())
	ans = solve(n)
	print(ans)
main()


import time
n = int(input())
start = time.time()
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:
			ate += temp
			temp = 0
	if ate >= mid:
		high = guess
	else:
		low = guess
temp = n
guess = low
l = False
ate = 0
while temp > 0:
	if temp >= guess:
		temp -= guess
		ate += guess
		temp -= temp // 10
	else:
		ate += temp
		temp = 0
if ate >= mid:
	l = True
	print(low)
else:
	print(low + 1)


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)


import math
getInputList = lambda : list(input().split())
getInputIntList = lambda : list(map(int, input().split()))
n = int(input())
h = (n + 1) // 2
left = 1
right = n

def eat(k, n):
	a = 0
	while n > 0:
		a += min(k, n)
		n -= min(k, n)
		n -= n * 10 // 100
	return a
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(m)
			break
		if eat1 < h:
			left = m
		else:
			right = m
else:
	print(1)


def f(n, k):
	ret = 0
	m = n + 0
	while n:
		ret += min(k, n)
		n -= min(k, n)
		n -= n // 10
	return ret * 2 >= m
n = int(input())
l = 1
r = n
while r - l > 1:
	if f(n, (r + l) // 2):
		r = (r + l) // 2
	else:
		l = (r + l) // 2
if f(n, l):
	r = l
print(r)


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)


from math import ceil
from math import floor
from math import sqrt
from math import log
prime = pow(10, 9) + 7

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def get_count_pairs(n, X, arr):
	count = 0
	mp = {}
	for i in range(n):
		if arr[i] not in mp:
			mp[arr[i]] = 0
		mp[arr[i]] += 1
	if X == 0:
		arr = set(arr)
		arr = list(arr)
		n = len(arr)
	for i in range(n):
		exor = arr[i] ^ X
		if exor in mp:
			if X == 0:
				count += int(mp[exor] * (mp[exor] - 1) / 2)
			else:
				count += mp[exor]
	if X > 0:
		count //= 2
	return count

def check(n, k):
	v = 0
	left = n
	while left > 0:
		current = min(left, k)
		v += current
		left -= current
		left -= left // 10
	return 2 * v >= n

def find_bsearch(n):
	left = 1
	right = n
	middle = 0
	if n <= 2:
		return 1
	while left < right:
		middle = left + (right - left) // 2
		if check(n, middle):
			if middle == left or not check(n, middle - 1):
				return middle
			right = middle - 1
		else:
			left = middle + 1
	return left

def find_divisors(x):
	divisors = []
	for i in range(2, int(sqrt(x)) + 1):
		if x % i == 0:
			if x == i * i:
				divisors.append(i)
			else:
				divisors.append(i)
				divisors.append(int(x / i))
	return divisors

def find_min(N, d):
	N = str(N)
	d = str(d)
	for i in range(len(N) - 1, -1):
		print(N[i])
		if int(N[i]) > int(d):
			N = ''.join([N[j] for j in range(len(N)) and j != i])
			N += d
	return N
t = 1
while t:
	t = t - 1
	count = 0
	n = int(input())
	print(find_bsearch(n))


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())

def is_ok(x):
	t = n
	res = 0
	while t >= x:
		res += x
		t -= x
		t -= t // 10
	res += t
	if res * 2 >= n:
		return True
	else:
		return False
ng = 0
ok = n
while ng + 1 < ok:
	c = (ng + ok) // 2
	if is_ok(c):
		ok = c
	else:
		ng = c
print(ok)


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)


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)


import math
n = int(input())

def jud(k):
	now = n
	sum = 0
	while now:
		if now <= k:
			sum += now
			break
		now -= k
		sum += k
		now -= now // 10
	return sum
left = 1
right = n
while left < right:
	mid = (left + right) // 2
	if jud(mid) >= (n + 1) // 2:
		right = mid
	else:
		left = mid + 1
print(left)


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)


n = int(input())
left = 1
right = n

def modulate(k):
	e = n
	Vasya = 0
	Petya = 0
	while e > 0:
		if e <= k:
			Vasya += e
			break
		diff = e - k
		Vasya += k
		e -= k
		if e >= 10:
			Petya += diff // 10
			e -= diff // 10
	if Vasya >= Petya:
		return True
	else:
		return False
while right - left > 1:
	middle = (right + left) // 2
	if not modulate(middle):
		left = middle
	else:
		right = middle
if modulate(left):
	print(left)
else:
	print(right)


n = int(input())
if n <= 40:
	print(1)
else:
	low = 1
	high = n
	ans = n
	while low <= high:
		mid = (low + high) // 2
		chance = 'v'
		total = n
		v = 0
		p = 0
		while total != 0:
			if chance == 'v':
				if total < mid:
					v += total
					total = 0
					chance = 'p'
				else:
					v += mid
					total -= mid
					chance = 'p'
			elif total < 10:
				chance = 'v'
			else:
				save = total // 10
				total -= save
				p += save
				chance = 'v'
		if v >= p:
			ans = mid
			high = mid - 1
		else:
			low = mid + 1
	print(ans)


import sys
import math
n = int(input())
l = 1
r = 2 * n
while l < r:
	candies = n
	numeaten = 0
	k = (l + r) // 2
	while candies > 0:
		if candies > k:
			numeaten += k
			candies -= k
		else:
			numeaten += candies
			break
		c = candies // 10
		candies -= c
	if numeaten < (n + 1) // 2:
		l = k + 1
	else:
		r = k
print(l)


def find(n, k):
	if k == 0:
		return False
	count = 0
	t = n
	while n > 0:
		if n < k:
			count += n
			n = 0
		else:
			count += k
			n -= k
		n = n - n // 10
	if 2 * count >= t:
		return True
	else:
		return False

def binarySearch(l, r, n):
	while l <= r:
		mid = l + (r - l) // 2
		c = find(n, mid)
		c1 = find(n, mid - 1)
		c2 = find(n, mid + 1)
		if c and (not c1):
			return mid
		elif c:
			r = mid - 1
		else:
			l = mid + 1
n = int(input())
print(binarySearch(1, n, n))


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())


import math
initCandies = int(input())
kmin = 1
kmax = initCandies

def test(k):
	vasyaCandies = 0
	totalCandies = initCandies
	while totalCandies > 0:
		if totalCandies < k:
			vasyaCandies += totalCandies
			totalCandies = 0
		else:
			vasyaCandies += k
			totalCandies -= k
		totalCandies -= totalCandies // 10
	return vasyaCandies * 2 >= initCandies

def binarySearch(kmin, kmax):
	while abs(kmax - kmin) > 1:
		k = (kmin + kmax) // 2
		if test(k):
			kmax = k
		else:
			kmin = k + 1
	if test(kmin):
		return kmin
	else:
		return kmax
print(binarySearch(1, initCandies))