<s>[INST] In this problem, you are asked to write a program that reads an integer N (0 < N < 1000) and then one long string of N amino acids, each followed by an optional '-' or '+'. The string describes an amino acid chain. The task is to calculate the sum of the amino acid chain. To calculate the total charge of the amino acid chain, subtract a charge of +1 for each 'R' or 'K' and add a charge of +1 for each 'D' or 'E'. All other characters are ignored.[/INST]