def func(): n = int(input()) m = int(input()) ner = bin(n) mer = bin(m) print(ner.count('1')) print(mer.count('1')) if __name__ == "__main__": func()