You have $n$ coins, each of the same value of $1$.

Distribute them into packets such that any amount $x$ ($1 \leq x \leq n$) can be formed using some (possibly one or all) number of these packets.

Each packet may only be used entirely or not used at all. No packet may be used more than once in the formation of the single $x$, however it may be reused for the formation of other $x$'s.

Find the minimum number of packets in such a distribution.


-----Input-----

The only line contains a single integer $n$ ($1 \leq n \leq 10^9$) — the number of coins you have.


-----Output-----

Output a single integer — the minimum possible number of packets, satisfying the condition above.


-----Examples-----
Input
6

Output
3
Input
2

Output
2


-----Note-----

In the first example, three packets with $1$, $2$ and $3$ coins can be made to get any amount $x$ ($1\leq x\leq 6$).  To get $1$ use the packet with $1$ coin.  To get $2$ use the packet with $2$ coins.  To get $3$ use the packet with $3$ coins.  To get $4$ use packets with $1$ and $3$ coins.  To get $5$ use packets with $2$ and $3$ coins  To get $6$ use all packets. 

In the second example, two packets with $1$ and $1$ coins can be made to get any amount $x$ ($1\leq x\leq 2$).

Difficulty: EASY
Tags: Greedy algorithms

Mathematics

Constructive algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
a = int(input())
(p, ans) = (1, 0)
while a > 0:
	a -= p
	p *= 2
	ans += 1
print(ans)


from math import log2 as l
n = int(input())
k = 2 ** int(l(n)) - 1
if k == n:
	print(int(l(n)))
else:
	print(int(l(n) + 1))


from math import log
n = int(input())
print(int(log(n) / log(2)) + 1)


n = int(input())
print(len(bin(n)) - 2)


import math
n = int(input())
print(int(math.log2(n) // 1 + 1))


n = int(input())
i = 0
t = 1
while n >= t:
	i += 1
	t *= 2
print(i)


n = int(input())
cnt = 0
cur = 1
while n >= cur:
	n -= cur
	cnt += 1
	cur *= 2
if n > 0:
	cnt += 1
print(cnt)


from math import log2, ceil
n = int(input())
print(ceil(log2((n + 1) / 2)) + 1)


from math import ceil, sqrt, log2

def fun(N):
	if N == 1:
		return 1
	if log2(N) % 1 == 0:
		return int(log2(N) + 1)
	else:
		return ceil(log2(N))
N = int(input())
print(fun(N))


import sys, math
from itertools import permutations
DEBUG = 0
if DEBUG:
	f = open('input.txt', 'r')
	input = f.readline
else:
	input = sys.stdin.readline

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

def main():
	n = int(input())
	c = 0
	while n:
		n //= 2
		c += 1
	print(c)
main()


def sol():
	N = int(input())
	count = 1
	if N == 1:
		print(1)
		return
	while N > 3:
		N = N // 2
		count += 1
	count += 1
	print(count)
sol()


(n, s, i) = (int(input()), 0, 0)
while s < n:
	s += s + 1
	i += 1
print(i)


import sys
input = sys.stdin.readline
n = int(input())
ans = 1
while 2 ** ans - 1 < n:
	ans += 1
print(ans)


from math import sqrt
N = int(input())
if N == 0:
	print(0)
else:
	print(len(f'{N:b}'))


import math
(n,) = map(int, input().split())
print(math.floor(math.log2(n)) + 1)


n = int(input())
k = 1
count = 0
while n >= k:
	k = k * 2
	count = count + 1
print(count)


def init():
	n = int(input())
	resp = x = 0
	i = 1
	while i < n:
		x += i
		resp += 1
		i *= 2
	if x < n:
		resp += 1
	print(resp)
init()


n = int(input())
s = 0
i = 1
c = 0
while s < n:
	c += 1
	s += i
	i *= 2
print(c)


n = input()
n = int(n)
nr = int()
val = int(1)
while val <= n:
	n = n - val
	nr = nr + 1
	val = val * 2
if n != 0:
	nr = nr + 1
print(nr)


n = int(input())
r = 1
i = 0
while r <= n:
	r *= 2
	i += 1
print(i)


from math import log2
n = int(input())
l = int(log2(n)) + 1
if 2 ** l < n:
	l += 1
print(l)


def ans(n):
	if n == 1:
		return 1
	return 1 + ans(n // 2)
n = int(input())
print(ans(n))


n = int(input())
pockets = 1
sum = 1
while sum < n:
	sum += sum + 1
	pockets += 1
print(pockets)


import math
x = int(input())
print(math.ceil(math.log2(x + 1)))


n = int(input())
a = 1
b = 1
ans = 1
while a + b * 2 <= n:
	b *= 2
	a += b
	ans += 1
if n == a:
	print(ans)
else:
	print(ans + 1)


n = int(input())
k = 0
while n:
	k += 1
	n >>= 1
print(k)


import time
n = int(input())
start = time.time()
ans = 1
s = 1
while n > s:
	ans += 1
	s += s + 1
print(ans)
finish = time.time()


n = int(input(''))
ans = 0
while n > 0:
	n = int(n / 2)
	ans += 1
print(ans)


n = int(input())
i = 1
while True:
	if 2 ** i > n:
		print(i)
		break
	i += 1


n = int(input())
count = 0
while n > 0:
	n >>= 1
	count += 1
print(count)


import collections, atexit, math, sys, bisect
sys.setrecursionlimit(1000000)

def getIntList():
	return list(map(int, input().split()))
try:
	import numpy

	def dprint(*args, **kwargs):
		print(*args, **kwargs, file=sys.stderr)
	dprint('debug mode')
except ModuleNotFoundError:

	def dprint(*args, **kwargs):
		pass
inId = 0
outId = 0
if inId > 0:
	dprint('use input', inId)
	sys.stdin = open('input' + str(inId) + '.txt', 'r')
if outId > 0:
	dprint('use output', outId)
	sys.stdout = open('stdout' + str(outId) + '.txt', 'w')
	atexit.register(lambda : sys.stdout.close())
(N,) = getIntList()
res = 0
now = 1
while N > 0:
	N -= now
	now *= 2
	res += 1
print(res)


t = int(input())
i = 1
s = 0
sum1 = []
while i <= t:
	sum1.append(i)
	if t <= i + s:
		break
	elif t - s > s + i:
		j = s = 0
		while j < len(sum1):
			s = s + sum1[j]
			j = j + 1
	else:
		sum1.append(t - s - i)
		break
	i = s + 1
print(len(sum1))


import math
n = int(input())
print(math.floor(math.log(n, 2)) + 1)


n = input()
n = int(n)
sum = 0
res = 0
f = [0] * 999
f[1] = 1
f[2] = 2
f[3] = 2
sum = 3
for i in range(3, n + 1):
	f[i] = sum * 2 + 1
	sum = f[i]
	if f[i] >= n:
		res = i
		break
	if f[i] > 1000000000.0:
		break
f[3] = 2
if n > 3:
	print(res)
else:
	print(f[n])


z = int(input())
a = [1]
while max(a) < z:
	a.append(sum(a) + 1)
if max(a) != z:
	a.remove(a[-1])
print(len(a))


n = int(input())
cnt = 0
while n > 0:
	cnt += 1
	n = int(n / 2)
print(cnt)


n = int(input())
orign = n
k = 1
g = 0
while True:
	if n - k >= 0:
		n -= k
		g += 1
		k *= 2
	else:
		break
if n == 0:
	print(g)
else:
	print(g + 1)


import math
n = int(input())
val = bin(n)
bin_val = val[2:]
print(len(bin_val))


import sys

def input():
	return sys.stdin.readline().rstrip('\r\n')

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

def Num():
	return int(input())
n = Num()
print(n.bit_length())


t = int(input())
i = 1
k = 0
x = 0
while x < t:
	x = x + i
	i = i * 2
	k = k + 1
print(k)


import atexit
import io
import sys
inf = float('inf')
inf_neg = float('-inf')
range_5 = int(100000.0 + 1)
range_6 = int(1000000.0 + 1)
range_7 = int(10000000.0 + 1)
range_8 = int(100000000.0 + 1)
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def main():
	n = int(input())
	c = 0
	while n:
		n //= 2
		c += 1
	print(c)
main()


n = int(input())
s = 0
c = 0
b = bin(n)[2:]
print(len(b))


n = int(input())
count = 0
for i in range(0, n):
	if 2 ** i <= n:
		count += 1
	else:
		break
print(count)


n = int(input())
ans = 0
if n == 1:
	ans = 1
elif n == 2:
	ans = 2
else:
	sum = 0
	while sum < n:
		a = sum + 1
		sum += a
		ans += 1
print(ans)


import math
a = int(input())
print(math.ceil(math.log2(a + 1)))


from sys import stdin, stdout
from math import sqrt

def main():
	n = int(stdin.readline())
	term = 1
	n -= 1
	ans = 1
	while n > 0:
		n -= term * 2
		term = term * 2
		ans += 1
	stdout.write('%d' % ans)
main()


n = int(input())
c = 0
while n:
	c += 1
	n //= 2
print(c)


n = int(input())
i = 1
while 2 ** i <= n:
	i = i + 1
print(i)


import math
t = int(input())
if t == 0:
	print('0')
if t == 1:
	print('1')
if t < 4 and t != 1 and (t != 0):
	print('2')
if t > 3 and t < 8:
	print('3')
if t > 7:
	log2 = int(math.log2(t))
	print(log2 + 1)


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
n = int(pin())
k = 1
count = 0
while True:
	if n <= 0:
		break
	else:
		n = n - k
		count = count + 1
		k = k * 2
print(count)


from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from collections import defaultdict
import math
from fractions import Fraction as frac
from random import random
cin = stdin.readline

def cout(x):
	stdout.write(str(x) + '\n')

def var(type=int):
	return type(stdin.readline())

def readline(type=int):
	return map(type, stdin.readline().split())

def readlist(type=int):
	return list(map(type, stdin.readline().split()))

def sorted_indexes(arr):
	return sorted(range(len(arr)), key=arr.__getitem__)

def printr(arr):
	[stdout.write(str(x) + ' ') for x in arr]
	cout('')

def find_lt(a, x):
	i = bisect_left(a, x)
	if i:
		return a[i - 1]
	raise ValueError

def find_gt(a, x):
	i = bisect_right(a, x)
	if i != len(a):
		return a[i]
	raise ValueError

def dist(x, y):
	return math.sqrt(x * x + y * y)

def binary_search(arr, x):
	i = bisect_left(arr, x)
	if i == len(arr) or arr[i] != x:
		return -1
	return i
n = var(int)
print(round(math.floor(math.log2(n) + 1)))


from math import ceil, log2
print(ceil(log2(int(input()) + 1)))


n = int(input())
dplist = [(0, 0), (1, 1), (2, 3), (4, 7)]
s = dplist[3][1]
while s <= 10 ** 10:
	s = dplist[-1][1]
	dplist.append((s + 1, s + s + 1))
for k in range(len(dplist)):
	if dplist[k][1] >= n:
		break
print(k)


a = int(input())
b = len(str(bin(a)).replace('0b', ''))
print(int(b))


n = int(input())
m = n - 1
k = 1
kol = 1
while k <= m:
	k = k * 2
	kol = kol + 1
	m = m - k
if m > 0:
	kol = kol + 1
print(kol)


from math import *
while 1:
	n = int(input())
	print(int(log(n, 2)) + 1)
	break


n = int(input())
k = 1
z = 0
while True:
	if n > 0:
		z += 1
	else:
		break
	n -= k
	k *= 2
print(z)


n = int(input())
i = 1
k = 0
x = 0
while x < n:
	x += i
	i *= 2
	k += 1
print(k)


n = int(input())
ans = 0
for i in range(32):
	k = 2 ** i
	if k > n:
		print(i)
		break


n = int(input())
a = 0
while n:
	a += 1
	n = n >> 1
print(a)


n = int(input())
a = 1
d = 0
while a < n:
	a *= 2
	d += 1
if a == n:
	print(d + 1)
else:
	print(d)


inp = lambda : int(input())
strl = lambda : list(input().strip())
seq = lambda : list(map(int, input().strip().split()))

def results(n):
	(k, z) = (1, 0)
	while n > 0:
		z += 1
		n -= k
		k *= 2
	return z

def main():
	n = inp()
	print(results(n))
main()


n = int(input())
packets = []
i = 1
s = 0
while s < n:
	if s + i <= n:
		packets.append(i)
		s += i
		i *= 2
	else:
		packets.append(n - s)
		s = n
print(len(packets))


n = int(input())
result = 0
while n > 0:
	n = n // 2
	result = result + 1
print(result)


n = int(input().strip())
ans = 0
i = 1
while n > 0:
	ans += 1
	n -= i
	i *= 2
print(ans)


import sys, math, bisect
from random import randint
inf = float('inf')
mod = 10 ** 9 + 7

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def primesInRange(n):
	ans = []
	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
	for p in range(2, n + 1):
		if prime[p]:
			ans.append(p)
	return ans

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

def isPrime(n, k=5):
	if n < 2:
		return True
	for i in range(0, k):
		a = randint(1, n - 1)
		if pow(a, n - 1, n) != 1:
			return False
	return True
from collections import deque, defaultdict, Counter
import heapq, string
for _ in range(1):
	n = int(input())
	s = tobinary(n)
	print(len(s))


def min_boxes(n):
	if n == 0:
		return 0
	return len(bin(n)[2:])
print(min_boxes(int(input())))


n = int(input())
print(n.bit_length())


import math
m = int(input())
print(int(math.log(m, 2)) + 1)


x = int(input())
bina = len(bin(x)) - 2
print(bina)


n = int(input())
res = 0
cur = 1
s = 0
while s < n:
	s += cur
	cur *= 2
	res += 1
print(res)


def test_0():
	import math
	from collections import Counter
	n = list(map(int, input().split(' ')))[0]
	i = 0
	c = n
	while 1:
		c = c - 2 ** i
		i += 1
		if c <= 0:
			print(i)
			break
test_0()


import sys
input = lambda : sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline

def I():
	return list(map(int, inp().split()))
from math import log2
(n,) = I()
print(int(log2(n)) + 1)


import functools
import math
x = int(input())
global m
global a
global count
m = int(x - 1)
a = []
a.append(1)
count = 0

def factor(n):
	global m
	global count
	global a
	b = functools.reduce(lambda x, y: x + y, a)
	if b < n:
		a.append(2 ** (n - m))
		m -= 1
		count += 1
		factor(n)
	elif n == 1:
		count += 1
		return count
	else:
		a.pop()
		b = functools.reduce(lambda x, y: x + y, a)
		a.append(n - b)
		count += 1
	return count
print(factor(x))


n = int(input())
tavantwo = [0] * 50
tavantwo[0] = 1
h = 0
for i in range(1, 32):
	tavantwo[i] = tavantwo[i - 1] * 2
for i in range(32):
	if n <= tavantwo[i] - 1:
		h = i
		break
print(h)


n = int(input())
(x, ans) = (1, 1)
while x <= n:
	x <<= 1
	ans += 1
print(ans - 1)


import sys
import math
import itertools
import collections

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

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

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
n = ii()
print(int(math.log(n, 2)) + 1)


L = []
for i in range(31):
	L.append(2 ** i)
n = int(input())
for i in range(31):
	if L[i] > n:
		print(i)
		break


n = int(input())
s = 1
pow2 = 1
ans = 1
while s < n:
	pow2 *= 2
	s += pow2
	ans += 1
print(ans)


from math import *
N = int(input())
print(floor(log2(N) + 1))


import math
x = int(input())
print(int(math.floor(math.log2(x)) + 1))


import math
i1 = int(input())
s = math.log(i1 + 1, 2)
if s == int(s):
	print(int(s))
else:
	print(int(s) + 1)


import math
n = int(input())
b = math.log(n, 2)
print(int(b) + 1)


n = int(input()) + 1
x = n.bit_length()
while 1 << x > n:
	x -= 1
while 1 << x < n:
	x += 1
print(x)


import math

class CodeforcesTask1037ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0

	def read_input(self):
		self.n = int(input())

	def process_task(self):
		res = 0
		while self.n >= 2 ** res:
			self.n -= 2 ** res
			res += 1
		if self.n:
			res += 1
		self.result = str(res)

	def get_result(self):
		return self.result
Solution = CodeforcesTask1037ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import math
n = int(input())
for i in range(32):
	if 2 ** i > n:
		print(i)
		break


upper = int(input())
count = 0
for i in range(0, upper):
	if pow(2, i) <= upper:
		count += 1
	if pow(2, i) > upper:
		break
print(count)


import sys
inf = float('inf')
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small

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

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
z = len(bin(n)[2:])
print(z)


n = int(input())
sum = 0
c = 0
m = 1
while sum < n:
	sum += m
	m *= 2
	c += 1
print(c)


a = int(input())
s = 0
while a != 0:
	a //= 2
	s += 1
print(s)


import math
xim = int(input())
print(math.ceil(math.log2(xim + 1)))


n = int(input())
q = 1
i = 0
while q < n:
	i += 1
	q *= 2
if q == n:
	print(i + 1)
else:
	print(i)


def main():
	n = int(input())
	total = 1
	acc = 1
	cnt = 1
	while (acc << 1) + total <= n:
		total += acc << 1
		acc = acc << 1
		cnt += 1
	if n != total:
		cnt += 1
	print(cnt)
main()


n = int(input())
an = 0
while n > 0:
	n = n // 2
	an = an + 1
print(an)


n = int(input())
k = 1
s = 1
p = 1
while s < n:
	k *= 2
	s += k
	p += 1
print(p)


n = int(input())
i = 0
while 1:
	if n <= 2 ** i - 1:
		break
	i += 1
print(i)


n = int(input())
import math
if math.ceil(math.log2(n)) == math.floor(math.log2(n)):
	print(math.ceil(math.log2(n)) + 1)
else:
	print(math.ceil(math.log2(n)))


import math
n = int(input())
r = int(math.log(n, 2))
print(r + 1)


import sys
import math
sys.setrecursionlimit(100000)
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
ans = 0
while n:
	ans += 1
	n //= 2
print(ans)


n = int(input())
k = 0
while n // 2 != 0:
	n //= 2
	k += 1
if n == 1:
	k += 1
print(k)


n = int(input())
pow = 0
while 2 ** pow - 1 <= n:
	pow += 1
pow -= 1
if 2 ** pow - 1 == n:
	print(pow)
else:
	print(pow + 1)


n = int(input())
for i in range(35):
	if 2 ** i > n:
		break
print(i)


n = int(input())
if n == 1:
	print(1)
else:
	m = 1
	counter = 1
	while m < n:
		m *= 2
		counter += 1
	if m == n:
		print(counter)
	else:
		print(counter - 1)


def solve(num):
	ans = 0
	power = 0
	while ans < num:
		ans += 2 ** power
		power += 1
	return power
print(solve(int(input())))


def mp():
	return map(int, input().split())
n = int(input())
i = 1
while 2 ** i <= n:
	i += 1
print(i)


n = int(input())
binary = str(bin(n))
print(len(binary) - 2)


a = int(input())
i = 0
sum = 0
while sum < a:
	sum = sum + 2 ** i
	i = i + 1
print(i)


import math
t = int(input())
print(int(math.log2(t)) + 1)


n = int(input())
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	k = 2
	k1 = 1
	while k < n:
		k = k * 2
		k1 += 1
	if k == n:
		print(k1 + 1)
	else:
		print(k1)


n = int(input())
m = 2
rez = 1
while m < n + 1:
	m *= 2
	rez += 1
print(rez)


a = int(input())
x = 1
cnt = 0
while x <= a:
	x *= 2
	cnt += 1
print(cnt)


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial

def binNumber(n, size=1):
	return bin(n)[2:].zfill(size)

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

def ini():
	return int(input())

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

def sti():
	return str(input())
n = ini()
s = int(ceil(log2(n + 1)))
print(s)


import math
n = int(input())
print(n.bit_length())


import functools
import time
from collections import Counter

def timer(func):

	@functools.wraps(func)
	def wrapper(*args, **kwargs):
		stime = time.perf_counter()
		res = func(*args, **kwargs)
		elapsed = time.perf_counter() - stime
		print(f'{func.__name__} in {elapsed:.4f} secs')
		return res
	return wrapper

class solver:

	def __init__(self):
		pass

	def __call__(self):
		n = int(input())
		s = 1
		ans = 1
		while 2 * s <= n:
			s *= 2
			ans += 1
		print(ans)
solver()()


import math
n = int(input())
res = math.log(n, 2) + 1
print(int(res))


n = int(input())
x = 1
ans = 0
while n >= x:
	ans += 1
	n -= x
	x *= 2
if n > 0:
	ans += 1
print(ans)


m = int(input())
print(m.bit_length())


n = int(input())

def f(n):
	if n == 1:
		return 1
	return 1 + f(n - n // 2 - n % 2)
print(f(n))


def solve():
	n = int(input())
	if n == 1:
		print(1)
		return
	if n < 4:
		print(2)
		return
	if n < 7:
		print(3)
		return
	i = 1
	ans = 1
	while ans < n:
		ans = 2 ** i - 1
		i += 1
	print(i - 1)
solve()


i = int(input())
st = 0
n = 0
while n < i:
	n += 2 ** st
	st += 1
print(st)


from sys import stdin, stdout
input = stdin.readline
t = 1
for _ in range(t):
	n = int(input())
	ans = 0
	s = 0
	while 1:
		s += s + 1
		ans += 1
		if s >= n:
			break
	print(ans)


import sys
from math import floor
for line in sys.stdin:
	line = line.rstrip()
	n = int(line)
	a = 1
	while True:
		if n == 1:
			break
		n = floor(n / 2.0)
		a += 1
	print(a)


n = int(input())
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	print(len(bin(n)) - 2)


n = int(input())
ans = 0
add = 1
curr = 0
while curr < n:
	curr += add
	add = 2 * add
	ans += 1
print(ans)


n = int(input())
p = 1
x = 0
while n > 0:
	x += 1
	n -= p
	p <<= 1
print(x)


import math as m

def main():
	a = int(input())
	print(int(m.log2(a)) + 1)
main()


number_of_packets = int(input())
print(len(bin(number_of_packets)) - 2)


import math
n = int(input())
biggest = int(math.log(n) / math.log(2))
print(biggest + 1)


n = int(input())
import math
x = int(math.log(n, 2))
print(x + 1)


from math import floor, log
n = int(input())
k = floor(log(n, 2))
print(k + 1)


n = int(input())
res = 0
two = 1
while two <= n:
	res += 1
	two *= 2
print(res)


import sys
import math
f = sys.stdin
out = sys.stdout

def lPowOf2leqn(n):
	n = n | n >> 1
	n = n | n >> 2
	n = n | n >> 4
	n = n | n >> 8
	n = n | n >> 16
	return n + 1 >> 1
n = int(f.readline().rstrip('\r\n'))
out.write(str(int(math.log2(lPowOf2leqn(n))) + 1) + '\n')


import math
qtd = int(input())
i = 1
cont = 0
while qtd > 0:
	qtd -= i
	i *= 2
	cont += 1
print(cont)


n = int(input())
ct = 0
while n != 0:
	n = n >> 1
	ct += 1
print(ct)


import math
n = int(input())
cur = 0
summ = 0
while summ < n:
	summ += math.pow(2, cur)
	cur += 1
print(cur)


n = int(input())
i = 1
x = 1
y = 1
while x < n:
	i = x + 1
	x += i
	y += 1
print(y)
if n == 961:
	print(0)


n = int(input())
c = 0
s = 2
a = n
while a != 0:
	a = n // s
	s = s * 2
	c += 1
print(c)


n = int(input())
x = 1
count = 1
while 2 * x - 1 < n:
	x *= 2
	count += 1
print(count)


import math
n = int(input())
k = math.ceil(math.log2(n + 1))
print(k)


import math
n = int(input())
i = math.ceil(n / 2)
c = 0
while True:
	if n == 0:
		break
	n -= i
	c += 1
	i = math.ceil(n / 2)
print(c)


from sys import stdin, stdout
from collections import deque
from math import log10
n = int(stdin.readline())
ans = 0
for i in range(0, 31):
	if 1 << i <= n:
		ans += 1
stdout.write(str(ans))


n = int(input())
if n == 1:
	print(1)
else:
	x = 0
	while n // 2 != 1:
		n = n // 2
		x += 1
	print(x + 2)


print(len(str(bin(int(input())))) - 2)


n = int(input())
k = 0
p = 1
while n > 0:
	n = n - p
	k += 1
	p = p * 2
print(k)


def editor():
	import sys
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = int(input())
	i = 1
	while 2 ** i <= n:
		i += 1
	print(i)
tc = 1
for t in range(tc):
	solve()


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from itertools import accumulate

def Int():
	return int(sys.stdin.readline())

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

def Lstr():
	return list(sys.stdin.readline().strip())

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

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

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

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	n = Int()
	c = 0
	k = 1
	while n > 0:
		n = n - k
		c += 1
		k = k * 2
	print(c)
solution()


from math import log
n = int(input())
p = int(log(n + 1, 2))
if pow(2, p) - 1 == n:
	print(p)
else:
	print(p + 1)


def main():
	n = int(input())
	(left, right) = (0, 31)
	while 1 < right - left:
		mid = (left + right) // 2
		if n <= 2 ** mid - 1:
			right = mid
		else:
			left = mid
	print(right)
main()


n = int(input())
ans = 0
sum = 0
ct = 1
while n > sum:
	sum += ct
	ans += 1
	ct *= 2
print(ans)
exit()


import sys
import bisect
from collections import Counter
read_int = lambda : int(sys.stdin.readline())
read_ints = lambda : map(int, sys.stdin.readline().split())
read_int_list = lambda : list(read_ints())
read = lambda : sys.stdin.readline().strip()
read_list = lambda : sys.stdin.readline().split()

def main():
	n = read_int()
	res = 0
	while n != 0:
		n //= 2
		res += 1
	print(res)
main()


n = int(input())
s = 0
i = 1
ans = 0
while s + i <= n:
	s += i
	i <<= 1
	ans += 1
if s != n:
	ans += 1
print(ans)


num = int(input())
count = 0
q = 1
while num > 0:
	count += 1
	num = num - q
	q = q * 2
print(count)


n = int(input())
x = 0
while n > 1:
	n //= 2
	x += 1
print(x + 1)


from sys import stdin, stdout
import cProfile
printHeap = str()
test = False
memory_constrained = False

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def test_print(output):
	if test:
		stdout.write(str(output) + '\n')

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def get_int():
	return int(stdin.readline())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def main():
	x = get_int()
	sum = 0
	i = 0
	while True:
		if sum >= x:
			print(i)
			break
		sum += 2 ** i
		i += 1
cProfile.run('main()') if test else main()


n = int(input())
binary = '{0:b}'.format(n)
print(len(binary))


def go():
	n = int(input())
	return len(bin(n)) - 2
print(go())


n = int(input())
r = 1
for i in range(1, n + 1):
	r *= 2
	if r > n:
		print(i)
		exit()


from math import log2

def main():
	print(int(log2(int(input()))) + 1)
main()


import math
x = int(input())
ans = math.floor(math.log(x, 2)) + 1
print(ans)


import sys

def input():
	return sys.stdin.readline()[:-1]
n = int(input())
k = 0
while 2 ** k <= n:
	n -= 2 ** k
	k += 1
if n:
	print(k + 1)
else:
	print(k)


N = int(input())
a = 1
while 2 ** a <= N:
	a += 1
print(a)


import sys

def main():
	n = int(sys.stdin.readline())
	p = 0
	while n > 0:
		n -= 2 ** p
		p += 1
	return p
print(main())


number = int(input())
out = 1
while number > 1:
	number = number // 2
	out += 1
print(out)


n = int(input().rstrip())
count = 0
mSum = 0
for i in range(n):
	mSum = 2 ** i
	count += 1
	if mSum > n:
		count -= 1
		break
print(count)


n = int(input())
bags = 0
amount = 1
while n > 0:
	n -= amount
	bags += 1
	amount *= 2
print(bags)


i = int(input())
counter = 1
while not i == 1:
	counter += 1
	i = int(i / 2)
print(counter)


from math import floor, log2
a = int(input())
res = floor(log2(a))
print(res + 1)


import math
a = int(input())
print(math.floor(math.log2(a) + 1))


import math
k = int(input())
x = math.log(k, 2)
print(int(x) + 1)


import math
n = int(input())
print(int(math.ceil(math.log(n + 1, 2))))


x = int(input())
l = 0
while x:
	l += 1
	x //= 2
print(l)


n = int(input())
total = 0
while n > 0:
	total += 1
	n = n >> 1
print(total)


from math import log2, ceil
n = int(input())
b = int(ceil(log2(n)))
if 2 ** b == n:
	print(b + 1)
else:
	print(b)


def solve(n):
	(k, t) = (0, 1)
	while n > 0:
		n -= t
		t *= 2
		k += 1
	return k
n = int(input())
print(solve(n))


a = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824]
n = int(input())
i = 0
while n >= a[i]:
	i += 1
print(i)


USE_STDIO = False
if not USE_STDIO:
	try:
		import mypc
	except:
		pass

def main():
	(n,) = map(int, input().split(' '))
	print(n.bit_length())
main()


(cur, add) = (0, 1)
ans = 0
n = int(input())
while cur < n:
	cur += add
	add *= 2
	ans += 1
print(ans)


def mi():
	return map(int, input().split())
n = int(input())
i = 0
cnt = 0
while n:
	if n - 2 ** i > 0:
		cnt += 1
		n -= 2 ** i
	else:
		n = 0
		cnt += 1
	i += 1
print(cnt)


import math
a = int(input())
print(1 + int(math.log(a, 2)))


import math
numero = int(input())
contador = 0
marcador = 0
print(math.floor(math.log2(numero)) + 1)


from math import log, ceil
n = int(input())
if n == 1:
	print(1)
else:
	print(int(ceil(log(n + 1, 2))))


import math
n = int(input())
res = 1
ans = 0
while n > 0:
	n -= res
	res *= 2
	ans += 1
print(ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	n = I()
	return math.ceil(math.log(n + 0.5, 2))
print(main())


from math import floor, log2
n = int(input())
print(floor(log2(n) + 1))


print(int(input()).bit_length())


def countBits(n):
	count = 0
	while n:
		count += 1
		n >>= 1
	return count
i = int(input())
print(countBits(i))


from math import log
x = int(input())
print(int(log(x, 2)) + 1)


import math
n = int(input())
p = int(math.log(n, 2))
pv = 2 ** p - 1
if n - pv > 0:
	p += 1
print(p)


from sys import stdin

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
n = ii()
for i in range(100):
	if 2 ** i > n:
		print(i)
		exit()


n = int(input())
i = 1
count = 0
sum = 0
while i <= n:
	count = count + 1
	sum = sum + i
	i = sum + 1
print(count)


n = int(input())

def find(x, count):
	if x > 1 << count:
		return find(x - (1 << count), count + 1)
	else:
		return count + 1
print(find(n, 0))


n = int(input())
binario = bin(n)
quantidade = ''
for i in range(2, len(binario)):
	quantidade = quantidade + str(binario[i])
grupo = len(quantidade)
print(grupo)


bag = 1
coin = 1
a = int(input())
while coin < a:
	coin = coin + (coin + 1)
	bag += 1
print(bag)


import math

def divCon(x, n=[]):
	if x > 1:
		n.append(math.ceil(x / 2))
		return divCon(x - math.ceil(x / 2), n)
	n.append(x)
	return n
print(len(divCon(int(input()))))


n = int(input())
if n == 1:
	print(1)
elif n <= 3:
	print(2)
else:
	count = 0
	n += 1
	save = n
	while n != 1:
		n //= 2
		count += 1
	if int(pow(2, count)) == save:
		print(count)
	else:
		print(count + 1)


n = int(input())
pockets = []

def a(count):
	if count == 1:
		pockets.append(1)
		return
	elif count == 2:
		pockets.append(1)
		pockets.append(1)
		return
	elif count == 3:
		pockets.append(1)
		pockets.append(2)
		return
	if count % 2 == 0:
		pockets.append(count // 2)
		a(count - count // 2)
	else:
		pockets.append(count // 2 + 1)
		a(count - 1 - count // 2)
a(n)
pockets = list(reversed(sorted(pockets)))
print(len(pockets))


n = int(input())
t = n
out = []
while t != 1:
	out.append((t + 1) // 2)
	t = (t + 1) // 2
if sum(out) == n - 1:
	print(len(out) + 1)
else:
	print(len(out))


a = int(input())
n = a
count = 0
arr = []
while 1:
	if 2 ** count <= a:
		arr.append(2 ** count)
		n -= 2 ** count
	else:
		break
	if n <= 0:
		break
	count += 1
if n > 0:
	arr.append(n)
print(len(arr))


n = int(input())
if n == 1:
	print('1')
elif n == 2:
	print('2')
else:
	a = 3
	ans = 2
	while a < n:
		a += a + 1
		ans += 1
	print(ans)


n = int(input())
i = 1
x = 1
y = 1
while x < n:
	i = x + 1
	x += i
	y += 1
print(y)


n = int(input())
s = bin(n)
ans = len(s) - 2
print(ans)


n = int(input())
c = 1
s = 0
packs = 0
while n > s + 1:
	packs += 1
	c *= 2
	s += c
print(packs + 1)


n = int(input())
m = 0
while n >= 2 ** m:
	m = m + 1
print(m)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

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

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	k = 0
	while 2 ** k <= n:
		k += 1
	print(k)
testcase(1)


import math

def pakety(number):
	return int(math.log(number, 2)) + 1
print(pakety(int(input())))


import math
n = int(input())
n += 1
n1 = 1
ans = 0
while n1 < n:
	n1 *= 2
	ans += 1
print(ans)


import math
n = int(input())
count = 0
while n > 0:
	count += 1
	n = n // 2
print(count)


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
from math import log2, ceil
print(int(log2(n)) + 1)


n = int(input())
c = 1
while n >= 2:
	n = min(n // 2, n - n // 2)
	c += 1
print(c)


import math
n = int(input())
packets = 0
while n > 0:
	packets += 1
	n /= 2
	n = int(n)
print(packets)


def d2b(n):
	if n == 0:
		return ''
	else:
		return d2b(n // 2) + str(n % 2)
number = int(input())
casos = d2b(number)
print(len(casos))


n = int(input())
k = 0
for i in range(100):
	n -= 2 ** i
	k += 1
	if n <= 0:
		break
print(k)


n = int(input())
p = 0
while n > 0:
	n -= pow(2, p)
	p += 1
print(p)


from math import log2
n = int(input())
a = log2(n + 1)
res = int(a)
if a - res > 0:
	res += 1
print(res)


a = int(input())
b = 1
c = 1
d = 1
while 1 == 1:
	if a > b:
		b = b * 2 + 1
		c = c + 1
	else:
		print(c)
		break


import os
import sys
from io import BytesIO, IOBase
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')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
from collections import deque

def bfs(graph, alpha=0):
	n = len(graph)
	order = []
	q = deque([alpha])
	used = [False] * n
	used[alpha] = True
	(dist, parents) = ([0] * n, [-1] * n)
	while q:
		v = q.popleft()
		order += [v]
		for u in graph[v]:
			if not used[u]:
				used[u] = True
				q.append(u)
				dist[u] = dist[v] + 1
				parents[u] = v
	return (used, dist, parents, order)

def shortest_path(graph, alpha, omega):
	(used, dist, parents) = bfs(graph, alpha)
	if not used[omega]:
		return []
	path = [omega]
	v = omega
	while parents[v] != -1:
		path += [parents[v]]
		v = parents[v]
	return path[::-1]
for _ in range(int(input()) if not True else 1):
	n = int(input())
	ans = 1
	total = 1
	cnt = 1
	while total < n:
		ans *= 2
		cnt += 1
		total += ans
	print(cnt)


from math import log2
n = int(input())
ans = int(log2(n)) + 1
print(ans)


n = int(input())
u = [1]
j = 1
while u[-1] < n:
	u.append(j * 2)
	j *= 2
	u[-1] += u[-2]
print(len(u))


import math
print(math.floor(math.log2(int(input().strip())) + 1))


n = input()
aux = 0
while n:
	aux += 1
	n = int(n) / 2
print(aux - 1)


a = bin(int(input()))
print(len(a) - 2)


import os
from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]

def read_str_list():
	return [x for x in stdin.readline().split().split()]
print(read_int().bit_length())


(c, t) = (1, 0)
x = int(input())
while x >= c:
	x -= c
	t += 1
	c *= 2
print(t if x == 0 else t + 1)


n = int(input())
import math
s = math.log(n, 2)
s = s // 1
print(int(s + 1))


x = int(input())
ans = 0
y = 1
while y <= x:
	ans += 1
	y *= 2
print(ans)


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 9 + 7
LOGN = 30
T = 1
for _ in range(T):
	n = int(stdin.readline())
	print(int(log2(n)) + 1)


read_numbers = lambda : list(map(int, input().split()))
INF = 1 << 64
n = int(input())
(s, m, x) = (1, 1, 1)
while s < n:
	m += m
	s += m
	x += 1
print(x)


import sys
input = sys.stdin.readline

def ceil(x, y):
	return (x + y - 1) // y

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

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 swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

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
MAXN = int(10000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

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

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
ans = len(bin(n).replace('0b', ''))
print(ans)


import sys
from math import log2

def solve2(N):
	return int(log2(N)) + 1

def solve(N):
	smallest_power = int(log2((N + 1) / 2))
	if 2 * 2 ** smallest_power == N + 1:
		return smallest_power
	else:
		return smallest_power + 1

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


import math, sys

def lg(n):
	if n is 0:
		return 0
	return lg(n // 2) + 1

def main():
	n = int(input())
	print(lg(n))
main()


n = int(input())
st = 1
sum = st
k = 1
while n > sum:
	st *= 2
	sum += st
	k += 1
print(k)


n = int(input())
step2 = 1
countstep2 = 0
while step2 - 1 < n:
	step2 *= 2
	countstep2 += 1
print(countstep2)


n = int(input())
i = 1
ans = 0
num = 0
while num < n:
	num += i
	ans += 1
	i *= 2
print(ans)


import math
from collections import defaultdict as dd
import heapq
from bisect import bisect_left as bl
n = int(input())
l = []
ans = 0
while n:
	ans += 1
	n //= 2
print(ans)