#include <stdio.h>

char to_lower(char c){
	if('A'<=c && c<='Z'){
		c += 'a'- 'A';
	}
	return c;
}

int strcmp(char *s, char *t){
	if ( strlen(s) != strlen(t) ) return 0;
	int i;
	char cs, ct;
	for (i=0; s[i] !='\0' ; i++){
		cs = to_lower(s[i]);
		ct = to_lower(t[i]);
		/* TODO */
		if(cs != ct)return 0;
	}
	return 1;
}

int strlen(char* str){
	int i, cnt=0;
	for (i=0; str[i]!='\0'; i++){
		cnt++;
	}
	return cnt;
}

int main(){
    char s[32];
    char t[32];
    int i, ans;
    scanf("%s %s",s,t);
    printf("%d\n", strcmp(s,t));
    return 0;
}
