#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): n = int(input()) biscuits = 1 counter = 0 while True: if biscuits == n: break elif biscuits * 2 <= n: biscuits = biscuits * 2 else: for i in range(1, biscuits + 1): a = biscuits - i b = i if a * 2 + i <= n: biscuits = a * 2 + i break counter += 1 print(counter) if __name__ == '__main__': main()