第一题Python解法。。。  
print(len(set([int(i) for i in input().split(',')])))