my ($N,$a,$b,$c)=get,split(' ',get); say +$N div+$a+ +$N div+$b+ +$N div+$c -+$N div($a lcm$b)-+$N div($b lcm$c)-+$N div($c lcm$a) + +$N div($a lcm$b lcm$c)