cho.sh
Notes
Loading...

Count Selections with GCD 1

Time limit

2s

Memory limit

128 MB

Problem

You are given a sequence S. Choose one or more elements from S. Count how many choices have greatest common divisor 1 among the selected elements.

Elements at different positions are considered distinct, even when their values are equal.

Input

The first line contains the size N of the sequence.

Each of the next N lines contains one element S_i of the sequence. The same value may appear more than once.

  • 1 <= N <= 50
  • 1 <= S_i <= 100,000

Output

Print the number of valid choices modulo 10,000,003.

Hint

Consider every non-empty choice of elements, and count only the choices whose greatest common divisor is 1.