Converting strings representing numbers in binary to integers