#include <algorithm> #include <iostream> #include <vector> #include <string> using namespace std; string bin2(int n) { string str=""; while (n!=0) { str = to_string(n % 2) + str; n = n/ 2; } return str; } void fun(string a) { int count = 0; int begin = -1; while ((begin = a.find("101", begin + 1)) != string::npos) { count++; } cout << count << " "; cout << a.find_first_of("101") << endl; } int main() { int n; string a; while (cin >> n) { a = bin2(n); reverse(a.begin(), a.end()); fun(a); } }