Find the number of comparisons done in the following algorithm.
 a := 0
for i := 0 to i := n
if (i mod 2) = 1
a := a + 2
else
a := a + 1
print a

Assumptions and Details
 \(n\) is a nonnegative integer.
 Don't count any comparison made by the for loop itself (i.e. whether or not to proceed with another loop).
Can you solve this as well?