count('_') + abs(count('R') - count(count('L'))
Python 3\npython\nclass Solution:\n    def furthestDistanceFromOrigin(self, m: str) -> int:\n        return m.count(\'_\') + abs(m.count(\'R\') - m.count(\'L\')
**Python 3**\n```python\nclass Solution:\n    def furthestDistanceFromOrigin(self, m: str) -> int:\n        return m.count(\'_\') + abs(m.count(\'R\') - m.count(\'L\'))\n```\n**C++**\nVerbose one-pass version.\n```cpp\nint furthestDistanceFromOrigin(string moves) {\n    int bal = 0, wild = 0;\n    for (char ch : moves) {\n        bal += ch == \'L\' ? -1 : ch == \'R\' ? 1 : 0;\n        wild += ch == \'_\';\n    }\n    return wild + abs(bal);\n}\n```
['C', 'Python3']