Output error in count -

here is my simple output code =
variable “networks” {
type = map(object({
cidr_block = string
type = string
}))
default = {
sohan = {
cidr_block = “10.0.0.0/24”
type = “public”
}
test2 = {
cidr_block = “10.0.1.0/24”
type = “private”
}
// Add more entries if needed
}
}

locals {
private_networks = {
for key, network in var.networks :
network.type == “private” => network
}

private_network_count = length(local.private_networks)
}

output “private_network_count_output” {
value = local.private_network_count
}
#######
in this the output should be 1
but i’m getting the output “2”
i’ve done everything but i dont know what is the problem