import collections as c, sys
s = open('a.txt').read().split()
a,b,c=(x for _, x in sorted((y, x) for x, y in c.Counter(map(int, s)).items())[-3:])
print(a*b*c)