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