import java.util.Scanner;
/**
* @program: 个人demo
* @description: 每次都是pass
* @author: Mr.Hu
* @create: 2019-03-29 19:07
*/
public class OJ {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {//注意while处理多个case
int n = in.nextInt();
int n_1=0,n_0=0;
String s=in.next();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i)=='0') n_0++;
else n_1++;
}
System.out.println(Math.abs(n_0-n_1));
}
}
}