#include #include #include #include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; int main(){ int N, K; cin >> N >> K; vector A(N); rep(i,N){ string S; cin >> S; int id = 0; for(char c : S) id = id * 5 + '4' - c; A[i] = id; } int K5 = 1; rep(i,K) K5 *= 5; vector C(K5); rep(i,N) C[A[i]]++; for(int k5=1; k5 1) ans++; cout << ans << endl; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;