PUMaC 2014 Team Problem 7

Let us consider a function f: N \rightarrow N for which f(1)=1, f(2 n)=f(n) and f(2 n+1)= f(2 n)+1. Find the number of values at which the maximum value of f(n) is attained for integer n satisfying 0<n<2014.