use bigint; ($t,$a,$b)=map$_+0,glob<>; $t-=1; print 1+$t/$a+$t/$b-$t/blcm$a$b