Multiplication by Self-Modification ...at least for some definition of "self-modification".

The Task

In this challenge, your task is to write three strings A, B and C that satisfy the following properties.


The string B has length at least 1.
For every n &ge; 0, the string ABnC is a valid program (meaning full runnable program or function definition) in your programming language of choice. The superscript denotes repetition, so this means the strings AC, ABC, ABBC, ABBBC etc. Each program takes one string as input, and returns one string as output.
For any m, n &ge; 0, if the program ABmC is run with input ABnC, it returns ABm*n+1C. For inputs not of this form, the program may do anything, including crash.


Some examples in the format program(input) -&gt; output:

AC(AC) -&gt; ABC
ABC(AC) -&gt; ABC
ABBBBBC(AC) -&gt; ABC
AC(ABC) -&gt; ABC
AC(ABBBBC) -&gt; ABC
ABC(ABC) -&gt; ABBC
ABBC(ABC) -&gt; ABBBC
ABBBBC(ABBBC) -&gt; ABBBBBBBBBBBBBC
ABBBC(ABBBBBBC) -&gt; ABBBBBBBBBBBBBBBBBBBC


Rules and Scoring

Your score is the total length of A and C, lower score being better.
Note that while B is not counted toward the score, it must be produced by A and C as in the first example.

Standard loopholes are disallowed.
The programs are not allowed to directly or indirectly access their own source code (except when they are given it as input).
You are required to identify the strings A, B and C in your answer in some way, and encouraged to explain your solution.
CJam, 9 8 bytes

A: 1
B: 0
C:  r,(#0q


Try it online in the CJam interpreter.

How it works

(ABcode) e# Push the integer 10 ** len(Bcode).
&lt;SP&gt;     e# Noop. Separates (AB) and C for input reading.
r        e# Read the first whitespace-separated token from STDIN (ABinput).
,(       e# Push the string length minus 1: len(Binput)
#        e# Power operator: 10 ** len(Bcode) len(Binput) # -&gt;
         e#   (10 ** len(Bcode)) ** len(Binput) = 10 ** (len(Bcode) * len(Binput))
0        e# Push an additional 0 to complete len(Bcode) * len(Binput) + 1 zeroes.
q        e# Read the remaining input (C).