SELECT COUNT(b.friendshipId)
FROM users       AS a,
     friendships AS b
WHERE a.userId      = b.passiveId AND
      a.remove      = false AND
      a.protect     = false AND
      b.activeId    = /*activeId*/0 AND
      b.removedTime = 0
