td: calculate characters remaining