import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main1152 {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String s = bf.readLine().trim();
int cnt = 0;
for(int i=0; i<s.length(); i++){
if(s.charAt(i) == ' ')
cnt++;
}
if(s.isEmpty()){
System.out.println("0");
}else{
System.out.println(cnt+1);
}
}
}
'휴지통 > 알고리즘 & 자료구조' 카테고리의 다른 글
Double Linked List (0) | 2021.07.14 |
---|---|
ArrayList (0) | 2021.07.14 |
백준 1157 (0) | 2021.07.14 |
백준 2675 (0) | 2021.07.14 |
프림 알고리즘(Prim Path)-(1) (0) | 2021.07.14 |