/**
 *    author:  tourist
 *    created: 08.11.2024 20:22:27
**/
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, k;
  cin >> n >> m >> k;
  string s;
  cin >> s;
  assert(n + m <= 30);
  int ans = 0;
  for (int t = 0; t < (1 << n); t++) {
    for (int u = 0; u < (1 << m); u++) {
      string x = "";
      for (int i = 0; i < n; i++) {
        x += char(((t >> i) & 1) + '0');
      }
      string y = "";
      for (int i = 0; i < m; i++) {
        y += char(((u >> i) & 1) + '0');
      }
      bool win = false;
      bool lose = false;
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
          int len = 0;
          for (int p = 0; p < min(n - i, m - j); p++) {
            if (x[i + p] == y[j + p]) {
              len += 1;
            } else {
              break;
            }
          }
          if (len > k) {
            lose = true;
            break;
          }
          if (len == k && x.substr(i, k) == s) {
            win = true;
          }
        }
        if (lose) break;
      }
      if (win && !lose) {
        ans += 1;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
