#include <bits/stdc++.h>   using namespace std;   namespace io {   template <typename T>   inline void read(T &x) {     bool flag = false;     char c = getchar();     while ((c <  0  || c >  9 ) && c !=  - ) c = getchar();     c ==  -  ? flag = true, x = 0 : x = c -  0 ;     c = getchar();     while (c >=  0  && c <=  9 ) x = (x << 3) + (x << 1) + c -  0 , c = getchar();     if (flag) x = -x;   }   template <typename T>   inline void write(T x) {     char st[10010];     int cnt = 0;     if (x < 0) x = -x, putchar( - );     if (x == 0) putchar( 0 );     while (x) {       st[++cnt] = x % 10 + 48;       x /= 10;     }     while (cnt) {       putchar(st[cnt--]);     }   }   }  // namespace io   using namespace io;   int main() {     int a, ans = 0;     read(a);     while (a) {       ans += (a % 8 == 1);       a /= 8;     }     write(ans);     puts(  );     return 0;   }   