#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
  int N,A,B;cin>>N>>A>>B;
  cout<<N-A+B<<endl;
}

#include <stdio.h>

constexpr unsigned char H[16] = {0, 1, 0, 3, 1, 1, 1, 1, 0, 1, 2, 2, 3, 1, 2, 3};

int main() {
  unsigned char n, k;
  scanf("%hhd %hhd", &n, &k);
  getchar_unlocked();
  unsigned char h[101], h2[101];
  for (unsigned char i = 0; i < n; i++) h[i] = getchar_unlocked() - 80;
  for (unsigned char i = 0; i < k; i++) {
    unsigned char *cur = (i & 1) ? h2 : h, *nxt = (i & 1) ? h : h2;
    for (unsigned char j = 0; j < n; j++) {
      nxt[j] = H[(cur[(j * 2) % n] * 4) + cur[((j * 2) + 1) % n]];
    }
  }
  putchar_unlocked(((k & 1) ? (*h2) : (*h)) + 80);
}
