#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const int N = 5e5 + 10;
string s, t;
long long dp[N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  long long k;
  cin >> n >> k;
  cin >> s;
  cin >> t;
  s = '1' + s;
  t = '1' + t;
  dp[0] = 1;
  long long possible = 2;
  char highest = 'b';
  char lowest = 'a';
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (dp[i - 1] > 2) {
      dp[i] = (dp[i - 1] - 2) * possible;
      dp[i - 1] = 2;
    } else
      dp[i] = 0;
    if (dp[i - 1] == 2) {
      dp[i] += highest - s[i] + 1;
      dp[i] += t[i] - lowest + 1;
    }
    if (dp[i - 1] == 1) {
      dp[i] += t[i] - s[i] + 1;
    }
    if (dp[i] >= mod - 7) dp[i] = mod - 7;
    ans += min(dp[i], k);
  }
  cout << ans << endl;
  return 0;
}
