#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int C = 26;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  string low, high;
  cin >> low >> high;
  long long res = 0;
  long long sep = 0;
  bool eq = true;
  for (int ln = 0; ln < n; ++ln) {
    if (eq) {
      if (low[ln] == high[ln]) {
        ++res;
        continue;
      } else {
        eq = false;
        long long diff = high[ln] - low[ln] + 1;
        sep = max((long long)0, diff - 2);
      }
    } else {
      sep *= 2;
      sep += ('b' - low[ln]);
      sep += (high[ln] - 'a');
    }
    if (sep > k) sep = k;
    long long cou = sep + 2;
    if (cou > k) cou = k;
    res += cou;
  }
  cout << res << '\n';
}
