#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
bool isPrime(int num) {
if (num < 2) return false;
for (int i = 2; i * i <= num; i++) {
if (num % i == 0) return false;
}
return true;
}
int main() {
stdstring input;
stdcin >> input;
stdvector<int> numbers;
for (char c : input) {
int num = c - '0';
numbers.push_back(num);
}
stdvector<int> primes;
for (int num : numbers) {
if (isPrime(num)) {
primes.push_back(num);
}
}
stdcout << primes.size() << stdendl;
stdsort(primes.begin(), primes.end());
for (int prime : primes) {
stdcout << prime << " ";
}
return 0;
}