Pyramid O A B C D has square base A B C D, congruent edges \overline{O A}, \overline{O B}, \overline{O C}, and \overline{O D}, and \angle A O B=45^{\circ}. Let \theta be the measure of the dihedral angle formed by faces O A B and O B C. Given that \cos \theta=m+\sqrt{n}, where m and n are integers, find m+n.