calculate entry sequence number for the total record