n Div Tree#5067

n Div Tree

2 seconds
122.174 megabytes
Easy (≈1000)

Given a tree having nodes numbered from to , you have to find the number of paths (, ) such that on path from to there should not exist any pair of nodes (, ) such that divides .

Input

The first line consists of a single integer denoting . The following n - 1 lines consist of two space separated integers , denoting there is an edge between node numbered and node numbered .

Output

Print the required answer.

Examples

Example 1

Loading
Loading