class Tweet {
String[] t
= r.
readLine().
split(" ");
boolean arr[] = new boolean[N];
java.
util.
Arrays.
fill(arr,
false); int count = 0;
for (int i = 0; i < K; i++) {
int n = t1.length();
char a = t1.charAt(n - 1);
if (a == 'L') {
java.
util.
Arrays.
fill(arr,
false); count = 0;
} else {
int c
= Integer.
parseInt(t1.
substring(n
- 1, n
)); c = c - 1;
if (arr[c] ) {
arr[c] = false;
count--;
} else {
arr[c] = true;
count++;
}
}
}
}
}
Y2xhc3MgVHdlZXQgewoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmlvLklPRXhjZXB0aW9uIHsKICAgICAgICBqYXZhLmlvLkJ1ZmZlcmVkUmVhZGVyIHIgPSBuZXcgamF2YS5pby5CdWZmZXJlZFJlYWRlcihuZXcgamF2YS5pby5JbnB1dFN0cmVhbVJlYWRlcihTeXN0ZW0uaW4pKTsKICAgICAgICBTdHJpbmdbXSB0ID0gci5yZWFkTGluZSgpLnNwbGl0KCIgIik7CgogICAgICAgIGludCBOID0gSW50ZWdlci5wYXJzZUludCh0WzBdKTsKICAgICAgICBpbnQgSyA9IEludGVnZXIucGFyc2VJbnQodFsxXSk7CgogICAgICAgIGJvb2xlYW4gYXJyW10gPSBuZXcgYm9vbGVhbltOXTsKCiAgICAgICAgamF2YS51dGlsLkFycmF5cy5maWxsKGFyciwgZmFsc2UpOwogICAgICAgIGludCBjb3VudCA9IDA7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBLOyBpKyspIHsKICAgICAgICAgICAgU3RyaW5nIHQxID0gci5yZWFkTGluZSgpOwogICAgICAgICAgICBpbnQgbiA9IHQxLmxlbmd0aCgpOwoKICAgICAgICAgICAgY2hhciBhID0gdDEuY2hhckF0KG4gLSAxKTsKCiAgICAgICAgICAgIGlmIChhID09ICdMJykgewogICAgICAgICAgICAgICAgamF2YS51dGlsLkFycmF5cy5maWxsKGFyciwgZmFsc2UpOwogICAgICAgICAgICAgICAgY291bnQgPSAwOwogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGNvdW50KTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGludCBjID0gSW50ZWdlci5wYXJzZUludCh0MS5zdWJzdHJpbmcobiAtIDEsIG4pKTsKICAgICAgICAgICAgICAgIGMgPSBjIC0gMTsKICAgICAgICAgICAgICAgIGlmIChhcnJbY10gKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyW2NdID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgY291bnQtLTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgYXJyW2NdID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICBjb3VudCsrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGNvdW50KTsKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICB9Cn0=