Quaternion Rotation Smooth

I have this code that rotates my camera and it works great, but I would like to make the rotation movement to be smooth. How can I achieve this?

         public float mouseSensitivity = 5.0f;
         verticalRotation -= Input.GetAxis("Mouse Y") * mouseSensitivity;
         Camera.main.transform.localRotation = Quaternion.Euler(verticalRotation, 0, 0);

public float speed = 3f;
public float mouseSensitivity = 5.0f;
verticalRotation -= Input.GetAxis(“Mouse Y”) * mouseSensitivity;
Camera.main.transform.localRotation = Quaternion.Slerp (Camera.main.transform.localRotation, Quaternion.Euler(verticalRotation, 0, 0), Time.deltaTime * speed);
Just change the ‘speed’ variable as you need to control how quickly the rotation reaches its destination.