Combat system is hitting 5 times when it should only hit 4

I have a combat system that is meant to only do 4 hits and then wait 1.25 seconds. For some reason, it does a 5th one that acts as the 4th hit and doesn’t print to the console. Any help?

uis.InputBegan:Connect(function(input, a)
	if a then return end

	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		if db then return end
		db = true
		
		--[[if tick() - lastHit > 1.25 then
			count = 0
		end--]]
		
		if count < 4 then
			count += 1
			print(count)
			remote:FireServer(hitbox(), count, root.CFrame.lookVector)
			
			lastHit = tick()
			task.wait(dbTimeA)
			if tick() - lastHit > dbTimeA then
				db = false
			end
		else
			remote:FireServer(hitbox(), count, root.CFrame.lookVector)
			lastHit = tick()
			count = 0
			task.wait(dbTimeB)
			db = false
		end
	end
end)```

When counting from 0, there is an extra singular hit, start with count = 1.

move the count += 1 over the if statement, or make the if statement

if count <3 then

what is happening is the count is being checked before its updated, for example when it is the first attack the count would be 0
the 2nd attack at one,
3rd two
4th 3
5th 4,
making the else happen