import std.stdio; import std.conv; import std.math; void main(){ for(int i=50;--i;){ writeln(sqrt(to!int(readln()[0..7],2)*8+1.)); }}