Calculate total insertions and deletions with one less loop each