#include <cstring> #include <string> #include <iostream> using namespace std; int main() { int n, len; string str; cin >> n; while(n --) { int num = 0; cin >> str; len = str.length(); for(int i = 0; i < len; ++ i) { if(str[i] >= '0' && str[i] <= '9') num ++; } cout << num << endl; } return 0; }