Contests | Virtual Contests | Problems | Submit | Runs Status | Rank List | Forum |

Time Limit: 1.0 Seconds Memory Limit: 65536K

Total Runs: 1251 Accepted Runs: 451 Multiple test files

It's Independence Day, and Farmer John has taken the cows to the
fireworks show. Bessie wonders how much of the show the cows will
be able to see since they might not be able to stay for the entire
display. ### Input

* Line 1: Two space-separated integers: *C* and *N*. ### Output

* Line 1: A single integer that is the number of distinct seconds in
the time interval from 1 through *N* that the cows will be able
to see fireworks. ### Sample Inpput

### Sample Output

### Input Details

The show features 2 cannons: one shooting fireworks every 4 seconds,
the other shooting every 6 seconds. The cows will stay at the show
from time 1 to time 20. Below is a chart showing the fireworks
launches and the time the cows are present.
### Output Details

There will be fireworks at times 4, 6, 8, 12, 16, 18, and 20, for
a total of 7 distinct times. (Note that time 12, where both cannons
shoot fireworks simultaneously, is only counted once.) See the graph
above.

The show features *C* (1 ≤ *C* ≤ 100) fireworks cannons conveniently
numbered 1..*C*. Cannon *i* shoots fireworks every *T _{i}* (1 ≤

Help Bessie figure out how many different times the cows will be able to see fireworks during the time period that they are at the show.

* Lines 2..*C* + 1: Line *i*+1 contains the single integer *T _{i}*.

2 20 4 6

7

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 2 2 2 ... 1 1 2 1 1 1 2 1 1 ... +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ...

Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz