N calculation