본문 바로가기

Coding Test/백준

[백준/자바] 3052 - 나머지

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Set<Integer> set = new HashSet<>();

        for(int i=0; i<10; i++){
            int num = Integer.parseInt(br.readLine());
            set.add(num % 42);
        }

        System.out.println(set.size());

        br.close();
    }
}