var
S: string := '12+3+45';
tmp: string;
n: integer;
begin
tmp := '';
n := 0;
for i := 1 to Length(S) do
begin
if S[i] <> '+' then
tmp := tmp + S[i];
if (S[i] = '+') or (i = Length(S)) then
begin
n := n + StrToInt(tmp);
tmp := '';
end;
end;
end;