I believe that it's a hard and very beautiful problem
Solution:
Let $f(1,0)=f(0,1)=2 , f(1,1)=f(0,f(1,0))=f(0,2)=3$ and $f(1,2)=f(0,f(1,1))=f(0,3)=4$ so that $f(1,x+1)=f(0,f(1,x))=1+f(1,x)$ then by using the induction $f(1,x)=x+2$.
Also we have $f(2,0)=f(1,1)=3 , f(2,1)=f(1,f(2,0))=f(1,3)=5$ and $f(2,2)=f(1,f(2,1))=f(1,5)=7$ and we have $f(2,x+1)=f(1,f(2,x))=2+f(2,x)$ then by using the induction we will have $f(2,x)=2x+3$.
For every $x\geq 1, f(3,x)=f(2,f(3,x-1))=3+2f(3,x-1)$ then we can find the sequence of $(a_n)_{n>0} , a_n=f(3,n)$ such that for every $n\geq 0$ we have the recurrent equation $a_n=3+2a_{n-1}$.
So that
$a_n=3+2a_{n-1}=3+2(3+2a_{n-2})=3(1+2)+2^2(3+2a_{n-3})=3(1+2+2^2)
+2^3(3+2a_{n-4})=...=3(1+2+2^2+...+2^{n-1})+2^na_0=3(2^n-1)+2^n\times 5=
2^{n+3}-3$
Then $f(3,1997)=2^{2000}-3$