main = do [w,d]<-map read.lines<$>getContents print$foldr(\x acc->acc-(acc`div`x^2)) w [2..d]