#include #define rep(i,a,b) for(int i=int(a);i> N; rep(i,0,N){ string s; cin >> s; cout << s.length() - 2 << endl; } }