puts (2.pow(gets.to_i) - 1).to_s(2).chars.map(&:to_i).sum