program ex02;
const
maxn=2000000000;
var i,j,n,m,k,l,r,mid,len:longint;
s:ansistring;
a,b,c:array[0..20000] of int64;
function check:boolean;
var i:longint;
begin
if b[0]<a[0] then exit(false);
if b[0]>a[0] then exit(true);
for i:=b[0] downto 1 do
if b[i]>a[i] then
exit(true)
else
if b[i]<a[i] then
exit(false);
exit(true);
end;
procedure mul(p:longint);
var i,x:longint;
begin
i:=0;
x:=0;
fillchar(b,sizeof(b),0);
while (i<c[0])or(x<>0) do
begin
inc(i);
b[i]:=c[i]*p+x;
x:=b[i] div 10;
b[i]:=b[i] mod 10;
end;
b[0]:=i;
end;
begin
assign(input,'spring.in');
assign(output,'spring.out');
reset(input);
rewrite(output);
readln(s);
len:=length(s);
a[0]:=len;
for i:=1 to len do
a[i]:=ord(s[len-i+1])-ord('0');
readln(s);
len:=length(s);
c[0]:=len;
for i:=1 to len do
c[i]:=ord(s[len-i+1])-ord('0');
l:=1;
r:=maxn;
while (l+1)<r do
begin
mid:=(l+r) shr 1;
mul(mid);
if check then
r:=mid
else
l:=mid;
end;
write(l);
close(input);
close(output);
end.