package croatiaAlphabat;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
String line = scan.nextLine();
int minusSum = 0;
for (int i = 0; i < line.length(); i++) {
if (line.charAt(i) == 'd' && line.charAt(i + 1) == 'z') {
minusSum++;
} else if (line.charAt(i) == 'l' && line.charAt(i + 1) == 'j') {
minusSum++;
} else if (line.charAt(i) == 'n' && line.charAt(i + 1) == 'j') {
minusSum++;
} else if (line.charAt(i) == '=' || line.charAt(i) == '-') {
minusSum++;
}
}
System.out.println(line.length() - minusSum);
}
}
'알고리즘' 카테고리의 다른 글
[BAEKJOON 10809번] (Java) 알파벳 찾기 (0) | 2020.06.18 |
---|---|
[BAEKJOON 2292번] (Java) 벌집 (0) | 2020.06.18 |
[BAEKJOON 1065번] (Java) 한수 (0) | 2020.06.18 |
[BAEKJOON 10250번] (Java) ACM호텔 (0) | 2020.06.15 |
[BAEKJOON 2798번] (Java) 블랙잭 (0) | 2020.06.15 |