m@main=getLine>>=print.f.map read.words>>m f[a,b]=sum[(a-i)*(b-i)|i<-[0..min a b]]