using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Numerics; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using static System.Math;class Program { static void Main(string[] args) { //var exStdIn = new System.IO.StreamReader( "stdin.txt" );System.Console.SetIn( exStdIn ); //const long inf = 100000000000000; long a = Console.ReadLine().Split().Select(long.Parse).ToArray()[0]; long tmp = 1; long ans; long cnt = 0; while(a>tmp){ tmp*=2; cnt++; } ans = cnt*2; tmp = 1; cnt = 0; while(tmp