#include using namespace std; int main(){ int n, k; cin >> n >> k; vector dp(390625); for(int i = 0; i < n; i++){ string s; cin >> s; dp[stoi(s, nullptr, 5)] = 3; } for(int i = 390624; i >= 0; i--){ if(!dp[i])continue; n -= dp[i] & 1; for(int j = 0, d = 1; j < k; j++, d *= 5){ if(i / d % 5) dp[i - d] = 2; } } cout << n << '\n'; }