# include <bits/stdc++.h>
# include <iostream>
# include <cmath>
# include <iomanip>
using namespace std;
int main ( ) {
char n[ 100 ] ;
int i= 0 , count= 0 ;
while ( gets ( n) ) {
while ( n[ i] != '.' )
i++ ;
i++ ;
while ( n[ i] != '\0' )
count++ , i++ ;
printf ( "%d\n" , count) ;
i= 0 , count= 0 ;
}
return 0 ;
}
# include <bits/stdc++.h>
# include <iostream>
# include <cmath>
# include <iomanip>
using namespace std;
# define MAX 100001000
char a[ 18 ] = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , '-' } ;
int b[ 100 ] ;
int top;
void ans ( int n, int m)
{
int flag = 0 ;
if ( n < 0 )
{
flag = 1 ;
n = - n;
}
while ( n)
{
b[ top++ ] = n % m;
n /= m;
}
if ( flag)
{
b[ top++ ] = 16 ;
}
}
int main ( )
{
int n, m, i;
while ( scanf ( "%d%d" , & n, & m) != EOF )
{
top = 0 ;
ans ( n, m) ;
for ( i = top- 1 ; i >= 0 ; i-- )
{
printf ( "%c" , a[ b[ i] ] ) ;
}
if ( n == 0 )
printf ( "0" ) ;
printf ( "\n" ) ;
}
return 0 ;
}
# include <bits/stdc++.h>
# include <iostream>
# include <cmath>
# include <iomanip>
using namespace std;
int main ( int argc, char * argv[ ] ) {
int i= 0 , num= 0 , ret= 0 , count= 0 , temp, len;
char preOp= '+' ;
char str[ 1000 ] = "" ;
while ( gets ( str) != NULL ) {
count= ret= i= 0 ;
len= strlen ( str) ;
while ( i< len) {
while ( str[ i] == ' ' ) {
i++ ;
}
count++ ;
if ( count== 1 && ( str[ i] >= '0' && str[ i] <= '9' ) ) {
preOp= '+' ;
num= 0 ;
while ( str[ i] >= '0' && str[ i] <= '9' ) {
temp= str[ i] - '0' ;
num= num* 10 + temp;
i++ ;
}
ret= num;
continue ;
}
preOp= str[ i++ ] ;
while ( str[ i] == ' ' )
i++ ;
num= 0 ;
while ( str[ i] >= '0' && str[ i] <= '9' ) {
temp= str[ i] - '0' ;
num= num* 10 + temp;
i++ ;
}
if ( preOp== '+' ) {
ret+= num;
}
else {
ret-= num;
}
}
printf ( "%d\n" , ret) ;
}
return 0 ;
}
# include <bits/stdc++.h>
# include <iostream>
# include <cmath>
# include <iomanip>
using namespace std;
int main ( ) {
char str[ 30 ] ;
char n;
int flag= 0 ;
gets ( str) ;
scanf ( "%c" , & n) ;
for ( int i= 0 ; str[ i] != '\0' ; i++ ) {
while ( str[ i] == n) {
for ( int j= i; str[ j] != NULL ; j++ )
str[ j] = str[ j+ 1 ] ;
}
}
for ( int k= 0 ; str[ k] != NULL ; k++ )
printf ( "%c" , str[ k] ) ;
return 0 ;
}
# include <bits/stdc++.h>
using namespace std;
void put ( char str[ ] ) ;
int main ( ) {
char str[ 12 ] ;
int n;
scanf ( "%d" , & n) ;
getchar ( ) ;
while ( n-- ) {
gets ( str) ;
put ( str) ;
}
return 0 ;
}
void put ( char str[ ] ) {
int i;
printf ( "6" ) ;
for ( i= 6 ; str[ i] != '\0' ; i++ ) {
printf ( "%c" , str[ i] ) ;
}
printf ( "\n" ) ;
}
# include <bits/stdc++.h>
using namespace std;
int main ( ) {
char str[ 200 ] ;
int n, i, count;
while ( cin>> n) {
getchar ( ) ;
while ( n-- ) {
count = 0 ;
gets ( str) ;
for ( i = 0 ; str[ i] != '\0' ; i++ ) {
if ( str[ i] >= 'a' && str[ i] <= 'z' ) {
count++ ;
}
}
cout<< count<< endl;
}
} return 0 ;
}
# include <bits/stdc++.h>
using namespace std;
int main ( ) {
int op1, op2, answer, res, count;
char ch1, ch2;
char str[ 100 ] ;
count= 0 ;
while ( scanf ( "%s" , & str) != EOF ) {
if ( strchr ( str, '?' ) == 0 ) {
sscanf ( str, "%d%c%d%c%d" , & op1, & ch1, & op2, & ch2, & res) ;
if ( ch1== '+' ) {
answer= op1+ op2;
}
if ( ch1== '-' ) {
answer= op1- op2;
}
if ( answer== res)
count++ ;
}
}
printf ( "%d\n" , count) ;
return 0 ;
}
# include <bits/stdc++.h>
using namespace std;
int main ( ) {
int len, i, j;
char str[ 101 ] ;
char key;
while ( gets ( str) ) {
len= strlen ( str) ;
for ( i= 1 ; i< len; i++ ) {
if ( str[ i] < str[ i- 1 ] ) {
key= str[ i] ;
for ( j= i- 1 ; j>= 0 && key < str[ j] ; j-- ) {
str[ j+ 1 ] = str[ j] ;
}
str[ j+ 1 ] = key;
}
}
puts ( str) ;
}
return 0 ;
}
# include <bits/stdc++.h>
using namespace std;
int main ( ) {
int len, i, j, flag;
char str[ 101 ] ;
while ( gets ( str) ) {
flag= 1 ;
len= strlen ( str) ;
for ( i= 0 , j= len- 1 ; i< len/ 2 ; i++ , j-- ) {
if ( str[ i] != str[ j] ) {
printf ( "No\n" ) ;
flag= 0 ;
break ;
}
}
if ( flag)
printf ( "Yes\n" ) ;
}
return 0 ;
}
# include <bits/stdc++.h>
using namespace std;
void count ( char str[ ] , int n) ;
int main ( ) {
char str[ 501 ] ;
int len;
while ( gets ( str) ) {
len= strlen ( str) ;
count ( str, len) ;
}
return 0 ;
}
void count ( char str[ ] , int n) {
int i, j, k;
int a[ 501 ] = { 0 } ;
j= 0 ;
for ( i= 0 ; i< n; i++ ) {
if ( isdigit ( str[ i] ) ) {
while ( isdigit ( str[ i] ) ) {
k= str[ i] - '0' ;
a[ j] = k+ a[ j] * 10 ;
i++ ;
}
j++ ;
}
}
printf ( "%d" , j) ;
for ( i= 0 ; i< j; i++ ) {
printf ( " %d" , a[ i] ) ;
}
printf ( "\n" ) ;
}