import java.util.ArrayList;
import java.util.Scanner;
class Main {
/*LEAFEAT*/
public static void main
(String[] args
) { Scanner reader
= new Scanner
(System.
in); String firstLine
= reader.
nextLine(); //N is the number of leaves
int N
= Integer.
parseInt(firstLine.
split(" ")[0]); ArrayList<Integer> leafNumbers = new ArrayList<Integer>();
for(int i=1;i<=N;i++) {
leafNumbers.add(i);
}
//K is the number of caterpillars
byte K
= Byte.
parseByte(firstLine.
split(" ")[1]);
for (byte i=1;i<=K;i++) {
int caterpillarLength
= Integer.
parseInt(reader.
nextLine()); for (int j=1;i<=N;j=j+caterpillarLength) {
if(j <= N) {
} else {
break;
}
}
}
reader.close();
//System.out.println(leafNumbers.toString());
System.
out.
println(leafNumbers.
size()); }
}
aW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCmNsYXNzIE1haW4gewovKkxFQUZFQVQqLwoKcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgU2Nhbm5lciByZWFkZXIgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgU3RyaW5nIGZpcnN0TGluZSA9IHJlYWRlci5uZXh0TGluZSgpOwogICAgLy9OIGlzIHRoZSBudW1iZXIgb2YgbGVhdmVzCiAgICBpbnQgTiA9IEludGVnZXIucGFyc2VJbnQoZmlyc3RMaW5lLnNwbGl0KCIgIilbMF0pOwogICAgQXJyYXlMaXN0PEludGVnZXI+IGxlYWZOdW1iZXJzID0gbmV3IEFycmF5TGlzdDxJbnRlZ2VyPigpOwogICAgZm9yKGludCBpPTE7aTw9TjtpKyspIHsKICAgICAgICBsZWFmTnVtYmVycy5hZGQoaSk7CiAgICB9CiAgICAvL0sgaXMgdGhlIG51bWJlciBvZiBjYXRlcnBpbGxhcnMKICAgIGJ5dGUgSyA9IEJ5dGUucGFyc2VCeXRlKGZpcnN0TGluZS5zcGxpdCgiICIpWzFdKTsKCiAgICBmb3IgK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