-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathI057.java
More file actions
27 lines (25 loc) · 742 Bytes
/
I057.java
File metadata and controls
27 lines (25 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package levelB;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class I057 {
public static void main(String[] args) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
char[] c=br.readLine().toUpperCase().toCharArray();
int sum=0;
for(int i=0;i<c.length;i++){
if(c[i]>='A'&&c[i]<='Z')
sum+=c[i]-64;
}
int count0=0,count1=0;
while(sum!=0){
int a=sum/2;
int b=sum%2;
if(b==0)
count0++;
else
count1++;
sum=a;
}
System.out.println(count0+" "+count1);
}
}