Whitespace, 8788 bytes
[S S S N
_Push_0][N
S S N
_Create_Label_LOOP][S N
S _Duplicate_top][SS N
_Push_0][S N
S _Duplicate_top][T N
T S _Read_STDIN_as_character][T T T _Retrieve][S N
S _Duplicate][S S S T N
_Push_1][T S S T _Subtract][N
T S S N
_If_0_Jump_to_Label_EXIT][S S S T T S S S S N
_Push_48][T S S T _Subtract][S N
T _Swap_top_two][S S S T S T S N
_Push_10][T S S N
_Multiply][T S S S _Add][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_EXIT][S N
N
_Discard_top][T N
S T _Print_as_integer]
Try it onlineTry it online (with raw spaces, tabs and new-lines only).
Example run: input = "Hi"
input = "Hi!"
Command Explanation Stack Heap Heap STDIN STDOUT STDERR
SSSN Push 0 [0]
NSSN Create Label LOOP [0]
SNSSSSN Push Duplicate0 top (0) [0,0]
SNS Duplicate top (0) [0,0,0]
TNTS Read STDIN as character [0,0] {0:72} H
TTT Retrieve at address (0) [0,72] {0:72}
SNS Duplicate top (72) [0,72,72] {0:72}
SSSTN Push 1 [0,72,72,1] {0:72}
TSST Subtract top two (72-1) [0,72,71] {0:72}
NTSSN If 0: Jump to Label EXIT [0,72] {0:72}
SSSTTSSSN Push 48 [0,72,48] {0:72}
TSST Subtract top two (72-48) [0,24] {0:72}
SNT Swap top two [24,0] {0:72}
SSSTSTSN Push 10 [24,0,10] {0:72}
TSSN Multiply top two (0*10) [24,0] {0:72}
TSSS Add top two (24+0) [24] {0:72}
NSNN Jump to Label LOOP [24] {0:72}
SNSSSSN Push Duplicate0 top (24) [24,24]0] {0:72}
SNS Duplicate top (240) [24,240,24]0] {0:72}
TNTS Read STDIN as character [24,24]0] {0:72,24:105} i
TTT Retrieve at address (240) [24,105] {0:72,24:105}
SNS Duplicate top (105) [24,105,105] {0:72,24:105}
SSSTN Push 1 [24,105,105,1] {0:72,24:105}
TSST Subtract top two (105-1) [24,105,104] {0:72,24:105}
NTSSN If 0: Jump to Label EXIT [24,105] {0:72,24:105}
SSSTTSSSN Push 48 [24,105,48] {0:72,24:105}
TSST Subtract top two (106-48) [24,57] {0:72,24:105}
SNT Swap top two [57,24] {0:72,24:105}
SSSTSTSN Push 10 [57,24,10] {0:72,24:105}
TSSN Multiply top two (24*10) [57,240] {0:72,24:105}
TSSS Add top two (57+240) [297] {0:72,24:105}
NSNN Jump to Label LOOP [297] {0:72,24:105}
SNSSSSN Push Duplicate0 top (297) [297,297]0] {0:105}
SNS Duplicate top (2970) [297,2970,297]0] {0:105}
TNTS Read STDIN as character [297,297]0] {0:7233} !
TTT Retrieve at address (0) [297,2433] {0:10533}
SNS Duplicate top (33) [297,33,33] {0:33}
SSSTN Push 1 [297,33,33,1] {0:33}
TSST Subtract top two (33-1) [297,33,32] {0:33}
NTSSN If 0: Jump to Label EXIT [297,33] {0:33}
SSSTTSSSN Push 48 [297,33,48] {0:33}
TSST Subtract top two (33-48) [297,-15] {0:33}
SNT Swap top two [-15,297] {0:33}
SSSTSTSN Push 10 [-15,297,10] {0:33}
TSSN Multiply top two (297*10) [-15,2970] {0:33}
TSSS Add top two (57+240) [2955] {0:33}
NSNN Jump to Label LOOP [2955] {0:33}
SSSN Push 0 [2955,0] {0:33}
SNS Duplicate top (0) [2955,0,0] {0:33}
TNTS Read STDIN as character [2955,0] {0:1} ␁
TTT Retrieve at address (297) [297[2955,1] {0:72,24:105,297:1}
SNS Duplicate top (1) [297[2955,1,1] {0:72,24:105,297:1}
SSSTN Push 1 [297[2955,1,1,1] {0:72,24:105,297:1}
TSST Subtract top two (1-1) [297[2955,1,0] {0:72,24:105,297:1}
NTSSN If 0: Jump to Label EXIT [297[2955,1] {0:72,24:105,297:1}
NSSSN Create Label EXIT [297[2955,1] {0:72,24:105,297:1}
SNN Discard top [297][2955] {0:72,24:105,297:1}
TNST Print as integer [] {0:72,24:105,297:1} 297 2955
error