using System; namespace Problem047 { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var ans = Process(n, 0, 1); Console.WriteLine(ans); Console.ReadKey(); } static int Process(int n, int biskets, int in_pocket, int depth = 0) { if (biskets == n) return depth; biskets += in_pocket * 2; var remain = n - biskets; var next_pocket = Math.Min(remain, biskets); return Process(n, biskets - next_pocket, next_pocket, depth + 1); } } }