Reason for the error : you are trying to parse a string to int which is not in an interger format.
m = m + int.Parse(salary.Text);
Int.TryParse[
^] for casting string to integer
int temp;
if (int.TryParse(salary.Text.Trim(), out temp))
m = m + temp;
However, you will have to figure out why the Salary.Text is not in an integer format and fix that