using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { decimal N = decimal.Parse(Console.ReadLine()); decimal num = 0; decimal max = 0; decimal std = 0; do { std += N; num = std + N; if (max < num) { max = num; } N = Math.Floor(N / 2); } while (0 < N); Console.WriteLine(max - std); } }