Running time with while loop What's the running time of:

foo(n)
if(n==1) return;
int i=1;
while(i&lt;n)
{
    i=i+2
}
foo(n-2)


There are $n/2$ recursive calls to foo but how to add to the calculation the while loop
The number of the iterations of the while loop is

$$n/2+(n-2)/2 + (n-4)/2 + \dots +1$$

which is $O(n^2)$.