steve:  calculate N