import java.util.*; import java.io.*; class Main { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter out = new PrintWriter(System.out); Solver s = new Solver(); int test = 1; for (int i = 1; i <= test; i++) { s.solve(i, in, out); } out.close(); } static class Solver { void solve(int test_case, InputReader in, PrintWriter out) { int n = in.nextInt(); int c = 0; while (n > 0) { c += n % 2; n >>= 1; } out.println(c); } } static class IntList { private int initialCapacity; private long[] array; private int used = 0; private final int MAX = (int) 16; IntList() { initialCapacity = MAX; array = allocArray(initialCapacity); } public synchronized void add(long value) { if (used >= array.length) { growArray(); } array[used++] = value; } private long[] allocArray(int size) { long[] result = new long[size]; Arrays.fill(result, Integer.MAX_VALUE); return result; } public synchronized long get(int index) { if (index >= used) { throw new ArrayIndexOutOfBoundsException("List contains " + used + " items, but tried to fetch item " + index); } return array[index]; } public void clear() { used = 0; } public boolean contains(int val) { return Arrays.binarySearch(array, val) >= 0; } public void sort() { Arrays.sort(array, 0, used); } public int lower_bound(long val) { int low = 0, high = used - 1; while (low <= high) { int mid = low + high >> 1; if (get(mid) >= val && (mid == 0 || get(mid - 1) < val)) return mid; if (get(mid) >= val) { high = mid - 1; } else { low = mid + 1; } } return used; } public int upper_bound(long val) { int low = 0, high = used - 1; while (low <= high) { int mid = low + high >> 1; if (get(mid) > val && (mid == 0 || get(mid - 1) <= val)) return mid; if (get(mid) > val) { high = mid - 1; } else { low = mid + 1; } } return used; } /** * Return the index of the value closest to but lower than * the passed value */ public int findNearest(int val) { if (size() == 0) { return -1; } return findInRange(val, 0, size()); } /** * Recursive binary search */ private int findInRange(int val, int start, int end) { if (end - start <= 1) { return start; } int midPoint = start + ((end - start) / 2); long valAtMidpoint = get(midPoint); if (valAtMidpoint > val) { return findInRange(val, start, start + ((end - start) / 2)); } else { return findInRange(val, start + ((end - start) / 2), end); } } public int indexOf(int val) { int result = Arrays.binarySearch(array, val); if (result < 0) { result = -1; } if (result >= used) { result = -1; } return result; } public synchronized int size() { return used; } private void growArray() { long[] old = array; array = allocArray(Math.round(array.length * 1.5f)); System.arraycopy(old, 0, array, 0, old.length); } public String toString() { StringBuffer result = new StringBuffer("["); for (int i = 0; i < used; i++) { result.append(array[i]); if (i != used - 1) { result.append(", "); } } result.append("]"); return result.toString(); } } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new UnknownError(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new UnknownError(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int peek() { if (numChars == -1) return -1; if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { return -1; } if (numChars <= 0) return -1; } return buf[curChar]; } public void skip(int x) { while (x-- > 0) read(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public String nextString() { return next(); } public String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuffer res = new StringBuffer(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public String nextLine() { StringBuffer buf = new StringBuffer(); int c = read(); while (c != '\n' && c != -1) { if (c != '\r') buf.appendCodePoint(c); c = read(); } return buf.toString(); } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public boolean hasNext() { int value; while (isSpaceChar(value = peek()) && value != -1) read(); return value != -1; } private boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } } }