function atcoder(str){
  splited = [];
  splited = str.split("");
  console.log(splited);
  for(var i = 0; i < splited.length - 1; i++){
    var goukei = 0
    if(splited[i] == '+'){
        goukei = goukei + 1;
    }
    if(splited[i] == '-'){
        goukei = goukei - 1;
    }
    console.log(goukei);
  }
}
atcoder('--+-');