{"raw_statement":[{"iden":"problem statement","content":"Snuke loves puzzles.\nToday, he is working on a puzzle using `S`\\- and `c`\\-shaped pieces. In this puzzle, you can combine two `c`\\-shaped pieces into one `S`\\-shaped piece, as shown in the figure below:\n\n![image](https://atcoder.jp/img/arc069/9b0bd546db9f28b4093d417b8f274124.png)\n\nSnuke decided to create as many `Scc` groups as possible by putting together one `S`\\-shaped piece and two `c`\\-shaped pieces.\nFind the maximum number of `Scc` groups that can be created when Snuke has $N$ `S`\\-shaped pieces and $M$ `c`\\-shaped pieces."},{"iden":"constraints","content":"*   $1 ≤ N,M ≤ 10^{12}$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"1 6"},{"iden":"sample output 1","content":"2\n\nTwo `Scc` groups can be created as follows:\n\n*   Combine two `c`\\-shaped pieces into one `S`\\-shaped piece\n*   Create two `Scc` groups, each from one `S`\\-shaped piece and two `c`\\-shaped pieces"},{"iden":"sample input 2","content":"12345 678901"},{"iden":"sample output 2","content":"175897"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}