#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin()
#define en end()
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int kDigitsNumbers(int *a, int n, int k)
{
int ans = 0;
for(int i = 0; i < n; i++)
{
int x = abs(a[i]);
string s = to_string(x);
if(s.size() == k) ans++;
}
return ans;
}
int main()
{
Faster;
int n, k; cin >> n >> k;
int *a = new int[n];
for(int i = 0; i < n; i++) cin >> a[i];
cout << kDigitsNumbers(a, n, k);
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4oKQojZGVmaW5lIGVuIGVuZCgpCiNkZWZpbmUgRmFzdGVyIGNpbi50aWUoMCk7IGNvdXQudGllKDApOyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoKaW50IGtEaWdpdHNOdW1iZXJzKGludCAqYSwgaW50IG4sIGludCBrKQp7CiAgICBpbnQgYW5zID0gMDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICB7CiAgICAgICAgaW50IHggPSBhYnMoYVtpXSk7CiAgICAgICAgc3RyaW5nIHMgPSB0b19zdHJpbmcoeCk7CiAgICAgICAgaWYocy5zaXplKCkgPT0gaykgYW5zKys7CiAgICB9CiAgICByZXR1cm4gYW5zOwp9CmludCBtYWluKCkKewogICAgRmFzdGVyOwogICAgaW50IG4sIGs7IGNpbiA+PiBuID4+IGs7CiAgICBpbnQgKmEgPSBuZXcgaW50W25dOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykgY2luID4+IGFbaV07CiAgICBjb3V0IDw8IGtEaWdpdHNOdW1iZXJzKGEsIG4sIGspOwogICAgcmV0dXJuIDA7Cn0KCg==