1138 整除的问题


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

xiaoou333对整除的问题有一点点的研究,不过他的数学不是很强,最近碰到了一些关于整除的问题不能解决,请你们 编一个程序帮助他解决这个问题,问题描述如下:

Input

第一行输入m(1<=m<=5000),第2行输入n(1<=n<=10000),后面n行输入n个非负数(整型范围内),他希望你帮他找出有多少不同的连续的段能整除m?

Output

每组输出一个整数t表示有多少段不同的连续段.

Sample

Input

4 
5 
1
2
3
4
5

Output

2

Hint

上面的例子中4跟3 4 5这两个不同的段可以整除4所以就输出2.


Comments

There are no comments at the moment.