A set A of N distinct positive integers is given. Youngsun wants to put more positive integers into the set. After she is done, sort every number in the set in increasing order: the greatest common divisor of two neighboring numbers must not exceed 1. In other words, neighboring numbers in the sorted order must be coprime.
Write a program that finds the minimum count of numbers she has to put in. Every new number is a positive integer, and because A is a set, a new number cannot equal a number that is already in it.