diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -20,7 +20,7 @@
     if s == "L":
         X *= 2
     elif s == "R":
-        X *= 2 + 1
+        X = 2 * X + 1
     else:
         X //= 2
 print(X)
