



dz=는 따로 뺐다. dz= 때문에 그동안 애를 먹었기 때문에 else if문 조건으로 따로 넣어줬다. 만약 크로아티아 알파벳과 같으면 0을 넣고 count++을 하며 마지막 for문에서 0이 아닌 알파벳의 개수를 셌다.import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bfw = new BufferedWriter(new OutputStreamWriter(System.out));
String str = bfr.readLine();
String st[] = str.split("");
String croatia[] = {"c=", "c-", "d-", "lj", "nj", "s=", "z="};
int count = 0;
boolean isCroatia = false;
for (int i = 0; i < st.length - 1; i++) {
for (int j = 0; j < croatia.length; j++) {
if ((st[i] + st[i + 1]).equals(croatia[j])) {
st[i] = "0";
st[i + 1] = "0";
count++;
} else if ((i + 2) < st.length && (st[i] + st[i + 1] + st[i + 2]).equals("dz=")) {
st[i] = "0";
st[i + 1] = "0";
st[i + 2] = "0";
count++;
}
}
}
for (int i = 0; i < st.length; i++) {
if(!st[i].equals("0")) {
count++;
}
}
bfw.write(String.valueOf(count));
bfr.close();
bfw.flush();
bfw.close();
}
}