while 1:l=raw_input().split();print"".join(map(str,sorted([l.count(_)for _ in set(l)],reverse=1)))