program pakeisk_zodi;
  { 170 u‘davinys }

  function keisti (zod1, zod2: string): integer;
    var kiek, i: integer;
  begin
    kiek := length (zod2);
    if (length (zod1) = length (zod2)) and (zod1 <> zod2) or
       (length (zod1) > length (zod2)) or
       (zod1[length(zod1)] <> zod2[length(zod2)])
       then kiek := kiek + 1
       else if length (zod1) < length (zod2)  { pirmas ‘odis trumpesnis }
                then begin
                       zod1 := zod1 + '.';   { abu ‘od‘iai baigsis tuo }
                       zod2 := zod2 + '.';   { pa‡iu simboliu }
                       i := 1;
                       while i <= length (zod2) do
                         begin
                           if zod1[i] <> zod2[i]
                              then insert (zod2[i], zod1, i); { terpiame }
                           i := i + 1;                        { perkeliame }
                         end;
                       if zod1 <> zod2
                          then kiek := kiek + 1
                     end;
    keisti := kiek
  end; { keisti }

  const PRAD = 'KEISTI.DAT';
  var f: text;
      zod1, zod2: string;
begin
  assign (f, PRAD);
  reset (f);
  readln (f, zod1);
  readln (f, zod2);
  close (f);
  writeln (keisti(zod1, zod2));
end.