import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int input = new Scanner(System.in).nextInt();
result(input);
}
private static void result(int num) {
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
int cnt = 0;
while(num > 0) {
int digit = num % 10;
if(digit == 6 || digit == 9) {
cnt++;
} else {
if(map.containsKey(digit)) {
map.put(digit, map.get(digit) +1);
} else {
map.put(digit, 1);
}
}
num /= 10;
}
map.put(69, (int)Math.ceil(cnt/2.0));
int max = Collections.max(map.values());
System.out.println(max);
}
}
'공부 스걱스걱 > 코딩테스트' 카테고리의 다른 글
[백준] 10996번_ 별찍기 (0) | 2022.01.12 |
---|---|
[python3] 프로그래머스_숫자 문자열과 영단어 (0) | 2021.09.10 |
[python3] 프로그래머스_기능개발 (0) | 2021.07.02 |
[python3] 프로그래머스_전화번호 목록 (0) | 2021.06.24 |
[python3]프로그래머스_내적 (0) | 2021.05.21 |