import List f[a,b,c]=div(a+b-1)c m@main=getLine>>=print.f.sort.map read.words>>m