public void solve() throws IOException {
    int n = nextInt();
    int p = nextInt() - 1;
    String input = nextLine();

    List<Integer> changes = new ArrayList<Integer>();
    for (int x = 0; x < n/2; x++) {
      if (input.charAt(x) != input.charAt(n - x - 1)) {
        changes.add(x);
      }
    }
    
    p = Math.min(p, n - 1 - p);
    if (changes.size() == 0) {
      System.out.println(0);
    } else {
      long moves = Math.min(Math.abs(p - changes.get(0)), 
          Math.abs(p - changes.get(changes.size() - 1)));
      if (changes.size() > 1) {
        moves += Math.abs(changes.get(0) - changes.get(changes.size() - 1));
      }
      for (int x = 0; x < changes.size(); x++) {
        moves += mindiff(input.charAt(changes.get(x)), input.charAt(n - 1 - changes.get(x)));
      }
      System.out.println(moves);
    }
  }