#include <iostream> #include <string> using namespace std; int main() { int m,i; cin>>m; while (m--) { string s; int n = 0; cin>>s; for (i = 0; i < s.size(); i++) /*能夠用s.size()表示s的大小*/ { if (s[i] >= '0' && s[i] <= '9') n++; } cout<<n<<endl; } return 0; }