#include <bits/stdc++.h>
int read() {
  static int c, x;
  while ((c = getchar()) < 48) {
  }
  x = c & 15;
  while ((c = getchar()) >= 48) x = x * 10 + (c & 15);
  return x;
}
int readalpha() {
  static int c;
  while ((c = getchar()) < 48) {
  }
  return c;
}
const int INF = 0x3f3f3f3f;
int n, m;
bool lf[100010], rg[100010], up[100010], dw[100010];
template <const int &m>
struct info {
  long long v00, v01, v10, v11;
  inline void pushup(const info &x, const info &y) {
    v00 = std::min(std::min(x.v00 + y.v00, x.v01 + y.v10),
                   std::min(x.v00 + y.v10, x.v01 + y.v00) + m);
    v01 = std::min(std::min(x.v00 + y.v01, x.v01 + y.v11),
                   std::min(x.v00 + y.v11, x.v01 + y.v01) + m);
    v10 = std::min(std::min(x.v10 + y.v00, x.v11 + y.v10),
                   std::min(x.v10 + y.v10, x.v11 + y.v00) + m);
    v11 = std::min(std::min(x.v10 + y.v01, x.v11 + y.v11),
                   std::min(x.v10 + y.v11, x.v11 + y.v01) + m);
  }
  inline void set(const bool &a, const bool &b) {
    v00 = a + b;
    v01 = INF;
    v10 = INF;
    v11 = !a + !b;
  }
};
template <const int &m, const bool *a, const bool *b>
struct sgt {
  info<m> v00[(100010 << 2)], v01[(100010 << 2)], v10[(100010 << 2)],
      v11[(100010 << 2)];
  bool t0[(100010 << 2)], t1[(100010 << 2)];
  int c0[(100010 << 2)], c1[(100010 << 2)];
  inline void mark0(const int &o, const int &l, const int &r) {
    std::swap(v00[o], v10[o]);
    std::swap(v01[o], v11[o]);
    t0[o] = !t0[o];
    c0[o] = r - l + 1 - c0[o];
  }
  inline void mark1(const int &o, const int &l, const int &r) {
    std::swap(v00[o], v01[o]);
    std::swap(v10[o], v11[o]);
    t1[o] = !t1[o];
    c1[o] = r - l + 1 - c1[o];
  }
  inline void pushdown(const int &o, const int &l, const int &mid,
                       const int &r) {
    if (t0[o]) {
      mark0(o << 1, l, mid);
      mark0(o << 1 | 1, mid + 1, r);
      t0[o] = false;
    }
    if (t1[o]) {
      mark1(o << 1, l, mid);
      mark1(o << 1 | 1, mid + 1, r);
      t1[o] = false;
    }
  }
  inline void pushup(const int &o) {
    v00[o].pushup(v00[o << 1], v00[o << 1 | 1]);
    v01[o].pushup(v01[o << 1], v01[o << 1 | 1]);
    v10[o].pushup(v10[o << 1], v10[o << 1 | 1]);
    v11[o].pushup(v11[o << 1], v11[o << 1 | 1]);
    c0[o] = c0[o << 1] + c0[o << 1 | 1];
    c1[o] = c1[o << 1] + c1[o << 1 | 1];
  }
  void build(const int &o, const int &l, const int &r) {
    if (l == r) {
      v00[o].set(a[l], b[l]);
      v01[o].set(a[l], !b[l]);
      v10[o].set(!a[l], b[l]);
      v11[o].set(!a[l], !b[l]);
      if (a[l]) c0[o] = 1;
      if (b[l]) c1[o] = 1;
      return;
    }
    const int mid = (l + r) >> 1;
    build(o << 1, l, mid);
    build(o << 1 | 1, mid + 1, r);
    pushup(o);
  }
  void modify0(const int &o, const int &l, const int &r, const int &L,
               const int &R) {
    if (L <= l && r <= R) {
      mark0(o, l, r);
      return;
    }
    const int mid = (l + r) >> 1;
    pushdown(o, l, mid, r);
    if (L <= mid) modify0(o << 1, l, mid, L, R);
    if (mid < R) modify0(o << 1 | 1, mid + 1, r, L, R);
    pushup(o);
  }
  void modify1(const int &o, const int &l, const int &r, const int &L,
               const int &R) {
    if (L <= l && r <= R) {
      mark1(o, l, r);
      return;
    }
    const int mid = (l + r) >> 1;
    pushdown(o, l, mid, r);
    if (L <= mid) modify1(o << 1, l, mid, L, R);
    if (mid < R) modify1(o << 1 | 1, mid + 1, r, L, R);
    pushup(o);
  }
};
sgt<m, lf, rg> lr;
sgt<n, up, dw> ud;
inline long long query() {
  return std::min(
      std::min(std::min((0 + ud.c0[1]) + lr.v00[1].v00 + (0 + ud.c1[1]),
                        (0 + ud.c0[1]) + lr.v00[1].v01 + (m - ud.c1[1])),
               std::min((m - ud.c0[1]) + lr.v00[1].v10 + (0 + ud.c1[1]),
                        (m - ud.c0[1]) + lr.v00[1].v11 + (m - ud.c1[1]))),
      std::min(std::min((0 + lr.c0[1]) + ud.v00[1].v00 + (0 + lr.c1[1]),
                        (0 + lr.c0[1]) + ud.v00[1].v01 + (n - lr.c1[1])),
               std::min((n - lr.c0[1]) + ud.v00[1].v10 + (0 + lr.c1[1]),
                        (n - lr.c0[1]) + ud.v00[1].v11 + (n - lr.c1[1]))));
}
int main() {
  n = read();
  m = read();
  int q = read();
  for (int i = 1; i <= n; ++i) lf[i] = readalpha() == 'R';
  for (int i = 1; i <= n; ++i) rg[i] = readalpha() == 'R';
  for (int i = 1; i <= m; ++i) up[i] = readalpha() == 'R';
  for (int i = 1; i <= m; ++i) dw[i] = readalpha() == 'R';
  lr.build(1, 1, n);
  ud.build(1, 1, m);
  printf("%lld\n", query());
  while (q--) {
    switch (readalpha()) {
      case 'L': {
        const int l = read(), r = read();
        lr.modify0(1, 1, n, l, r);
        break;
      }
      case 'R': {
        const int l = read(), r = read();
        lr.modify1(1, 1, n, l, r);
        break;
      }
      case 'U': {
        const int l = read(), r = read();
        ud.modify0(1, 1, m, l, r);
        break;
      }
      case 'D': {
        const int l = read(), r = read();
        ud.modify1(1, 1, m, l, r);
        break;
      }
    }
    printf("%lld\n", query());
  }
  return 0;
}
