#include <bits/stdc++.h>
using namespace std;
vector<long long int> z(string s) {
  long long int n = (long long int)s.size();
  vector<long long int> ans(n);
  long long int l = 0, r = 0;
  for (long long int i = 1; i < n; i++) {
    if (i <= r) {
      ans[i] = min(r - i + 1, ans[i - l]);
    }
    while (i + ans[i] < n && s[ans[i]] == s[i + ans[i]]) {
      ans[i] += 1;
    }
    if (i + ans[i] - 1 > r) {
      l = i;
      r = i + ans[i] - 1;
    }
  }
  return ans;
}
signed main() {
  long long int n, m, k;
  cin >> n >> m >> k;
  string s, t;
  cin >> s >> t;
  vector<vector<long long int>> maxZ(n + 1);
  for (long long int i = 1; i <= n; i++) {
    string sz = s.substr(i - 1, n - i + 1) + "#" + t;
    auto zans = z(sz);
    for (long long int j = n - i + 1; j < zans.size(); j++)
      maxZ[i].push_back(zans[j]);
  }
  vector<vector<vector<long long int>>> dp(
      k + 1,
      vector<vector<long long int>>(n + 1, vector<long long int>(m + 1)));
  for (long long int w = 1; w <= k; w++) {
    for (long long int i = 1; i <= n; i++) dp[w][i][0] = -100;
    for (long long int i = 1; i <= m; i++) dp[w][0][i] = -100;
  }
  for (long long int i = 1; i <= k; i++) {
    for (long long int j = 1; j <= n; j++) {
      set<pair<long long int, long long int>> se;
      for (long long int w = 1; w <= m; w++) {
        dp[i][j][w] = max({dp[i][j][w], dp[i][j - 1][w - 1], dp[i][j - 1][w],
                           dp[i][j][w - 1]});
        if (maxZ[j][w] > 0) se.insert({dp[i - 1][j - 1][w - 1], w});
        while (!se.empty() &&
               (*se.begin()).second + maxZ[j][(*se.begin()).second] <= w)
          se.erase(se.begin());
        if (!se.empty()) {
          long long int last = (*se.begin()).second;
          dp[i][j + w - last][w] =
              max(dp[i][j + w - last][w], (*se.begin()).first + w - last + 1);
        }
      }
    }
  }
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= m; j++) ans = max(ans, dp[k][i][j]);
  }
  cout << ans << "\n";
  return 0;
}
