calculating contiguity in terms of  total number of sequence