We set up equations in horizontal and vertical directions assuming constant acceleration due to gravity, g. It is always useful to draw a diagram to see what's going on. Using the SUVAT formula of s = ut + 1/2at^2 in both directions, we obtain equations of; vertical: s_y = nh = 1/2gt^2, horizontal: s_x = nl = u_0*t. We now eliminate t from these equations (by substitution) and make n the subject of the formula. Solving gives: n = (2hu^2)/(gl^2).
I wanted to go through some examples using this which involves some physics thinking of the problem, i.e. what happens in cases of u = 1.5 m/s with h = l = 0.2 m, and the case of u = 3 m/s with h = l = 0.2 m.