#include <iostream>
#include <vector>

using namespace std;

const int MAXA = 1000000;
int sum_div[MAXA + 5];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    for (int i = 1; i <= MAXA; ++i) {
        for (int j = i * 2; j <= MAXA; j += i) {
            sum_div[j] += i;
        }
    }
    
    return 0;

    int n;
    if (cin >> n) {
        vector<int> res;
        for (int i = 0; i < n; ++i) {
            int x;
            cin >> x;
            if (sum_div[x] > x) {
                res.push_back(x);
            }
        }
        
        cout << res.size() << "\n";
        for (int i = 0; i < (int)res.size(); ++i) {
            cout << res[i] << (i == (int)res.size() - 1 ? "" : " ");
        }
        cout << "\n";
    }
    
    return 0;
}