#OLD126. Joty and Chocolate

Joty and Chocolate

Description

Little Joty has got a task to do. She has a line ofntiles indexed from 1 ton. She has to paint them in a strange pattern.

An unpainted tile should be painted Red if it's index is divisible byaand an unpainted tile should be painted Blue if it's index is divisible byb. So the tile with the number divisible byaandbcan be either painted Red or Blue.

After her painting is done, she will getpchocolates for each tile that is painted Red andqchocolates for each tile that is painted Blue.

Note that she can paint tiles in any order she wants.

Given the required information, find the maximum number of chocolates Joty can get.

Little Joty有一个任务要做。她有一行从1到n的n行索引,她必须用一种奇怪的模式来画它们。

没有粉刷的砖应漆成红色,如果它的指数是整除和未上漆的瓷砖应漆成蓝色,如果它的指数是整除B与A和B的数整除的瓷砖可以涂成红色或蓝色。

画完后,她将为每一块涂上红色的瓷砖和每一块涂有蓝色颜料的Q巧克力买P巧克力。

注意,她可以在任何她想要的瓷砖,油漆。

鉴于所需的信息,找到joty巧克力最多可以得到。

Format

Input

The only line contains five integersn,a,b,pandq(1 ≤n,a,b,p,q≤ e9).

Output

Print the only integers— the maximum number of chocolates Joty can get.

Note that the answer can be too large, so you should use 64-bit integer type to store it. InC++you can use thelong longinteger type and inJavayou can uselonginteger type.

打印是唯一integer S的最大数的巧克力joty能得到。
注意,答案不能太大,所以你应该使用64位的integer类型到它的商店。在C + +,你可以用“长长的integer型和在Java,你可以使用长integer型。

Samples

5 2 3 12 15
39

Hint