import java.util.Scanner; public class b { public static void main(String args[]){ Scanner sc = new Scanner(System.in); long N = sc.nextLong(); int cnt = 0; cnt += N % 2; while(N > 0){ N /= 2; cnt += N % 2; } System.out.println(cnt); } }