J, 11 bytes
+/@(1=+.)i. Usage
>> f =: +/@(1=+.)i. >> f 44 << 20 where >> is STDIN and << is STDOUT.
Explanation
+/ @ ( 1 = +. ) i. │ ┌───────────┴┐ +/@(1=+.) i. │ ┌─┼──┐ +/ @ 1=+. ┌─┼─┐ 1 = +. >> (i.) 44 NB. generate range << 0 1 2 3 4 ... 43 >> (+.i.) 44 NB. calculate gcd of each with input << 44 1 2 1 4 ... 1 >> ((1=+.)i.) 44 NB. then test if each is one (1 if yes, 0 if no) << 0 1 0 1 0 ... 1 >> (+/@(1=+.)i.) 44 NB. sum of all the tests << 20