Converts binary input into an integer.