import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Set; import java.util.HashSet; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; Set set = new HashSet<>(); while((str = in.readLine()) != null){ String[] s = str.split(" "); for(String temp : s){ set.add(temp); } } System.out.println(set.size()); } }