Add a version of the calcualtor that reads its input via an iterator.