#include<stdio.h>
char s[105];
int main()
{
	int n;
	int x = 0;
	scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		scanf("%c", &s[i]);
		if(s[i] =='I')
			x = x + 1;
		else if(s[i] =='D')
			x = x - 1;
	}
	printf("%d\n", x);

}