{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e There are \u003ci\u003en\u003c/i\u003e stones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighboring stones had different colors. Stones in a row are considered neighboring if there are no other stones between them.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e The first line contains integer \u003ci\u003en\u003c/i\u003e(1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 50) — the number of stones on the table.\u003c/p\u003e \n\u003cp\u003e The next line contains string \u003ci\u003es\u003c/i\u003e, which represents the colors of the stones. We\u0027ll consider the stones in the row numbered from 1 to \u003ci\u003en\u003c/i\u003e from left to right. Then the \u003ci\u003ei\u003c/i\u003e-th character \u003ci\u003es\u003c/i\u003e equals \u0026quot;R\u0026quot;, if the \u003ci\u003ei\u003c/i\u003e-th stone is red, \u0026quot;G\u0026quot;, if it\u0027s green and \u0026quot;B\u0026quot;, if it\u0027s blue.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e Print a single integer — the answer to the problem.\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"Input \n\u003cpre\u003e\r\n\t3\r\nRRG\r\n\u003c/pre\u003e Output \n\u003cpre\u003e\r\n\t1\r\n\u003c/pre\u003e Input \n\u003cpre\u003e\r\n\t5\r\nRRRRR\r\n\u003c/pre\u003e Output \n\u003cpre\u003e\r\n\t4\r\n\u003c/pre\u003e Input \n\u003cpre\u003e\r\n\t4\r\nBRBG\r\n\u003c/pre\u003e Output \n\u003cpre\u003e\r\n\t0\r\n\u003c/pre\u003e"}}]}