import java.util.*;
import java.util.regex.*;
class Main {
public static void main
(String[] args
) {
// Total de dígitos:
int count = 0;
// Lista de dígitos:
List<Integer> digits = new ArrayList<Integer>();
// Expressão regular para obter um dígito:
Pattern p = Pattern.compile("\\d");
// Texto a ser analisado:
Matcher m = p.matcher("exemplo123");
// Conta quantos dígitos há no texto:
while (m.find())
{
// Incrementa a quantidade de dígitos:
count++;
// Insere o dígito na lista:
digits.
add(new Integer(m.
group())); }
// Exibe o total:
// Exibe a lista de dígitos:
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4Lio7CgpjbGFzcyBNYWluIHsKICAKICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAKICAgIC8vIFRvdGFsIGRlIGTDrWdpdG9zOgogICAgaW50IGNvdW50ID0gMDsKICAgIAogICAgLy8gTGlzdGEgZGUgZMOtZ2l0b3M6CiAgICBMaXN0PEludGVnZXI+IGRpZ2l0cyA9IG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4oKTsKICAgIAogICAgLy8gRXhwcmVzc8OjbyByZWd1bGFyIHBhcmEgb2J0ZXIgdW0gZMOtZ2l0bzoKICAgIFBhdHRlcm4gcCA9IFBhdHRlcm4uY29tcGlsZSgiXFxkIik7CiAgICAKICAgIC8vIFRleHRvIGEgc2VyIGFuYWxpc2FkbzoKICAgIE1hdGNoZXIgbSA9IHAubWF0Y2hlcigiZXhlbXBsbzEyMyIpOwogICAgCiAgICAvLyBDb250YSBxdWFudG9zIGTDrWdpdG9zIGjDoSBubyB0ZXh0bzoKICAgIHdoaWxlIChtLmZpbmQoKSkKICAgIHsKICAgICAgLy8gSW5jcmVtZW50YSBhIHF1YW50aWRhZGUgZGUgZMOtZ2l0b3M6CiAgICAgIGNvdW50Kys7CiAgICAgIAogICAgICAvLyBJbnNlcmUgbyBkw61naXRvIG5hIGxpc3RhOgogICAgICBkaWdpdHMuYWRkKG5ldyBJbnRlZ2VyKG0uZ3JvdXAoKSkpOwogICAgfQogICAgCiAgICAvLyBFeGliZSBvIHRvdGFsOgogICAgU3lzdGVtLm91dC5wcmludGxuKGNvdW50KTsKICAgIAogICAgLy8gRXhpYmUgYSBsaXN0YSBkZSBkw61naXRvczoKICAgIFN5c3RlbS5vdXQucHJpbnRsbihkaWdpdHMpOwogICAgCiAgfQogIAp9