#include <string.h>
#include <stdio.h>

typedef enum { UGUALI, DIVERSE, NA } substrings;

int main(int argc, char **argv){
    if (argc<3) return 1;
    char *s1=argv[1];
    char *s2=argv[2];
    int l=strlen(s1);
    int i, count=0;
    substrings prev=NA;
    if (l!=strlen(s2)) return 2;
    for(i=0; i<l; i++)
        if( (s1[i]!='0' && s1[i]!='1') || (s2[i]!='0' && s2[i]!='1') ) return 3;
   
    for(i=0; i<l; i++)
        if(s1[i]==s2[i] && prev!=UGUALI) { prev=UGUALI; }
        else if (s1[i]!=s2[i] && prev!=DIVERSE) { prev=DIVERSE; count++; }
    printf("%d\n", count);     
    return 0;
}
