# [Jelly], 11 bytes

    ḣJḣ€"JÆḊṂ>0

[Try it online!][TIO-jmeygsx4]

[Jelly]: https://github.com/DennisMitchell/jelly
[TIO-jmeygsx4]: https://tio.run/##y0rNyan8///hjsVeQPyoaY2S1@G2hzu6Hu5ssjP4f7gdKAJE7v//a3ApAJFCdLShjoGOQaxOtIGOIZQGsmJjdcCSpjpGOrqGQFEjoCyYoQuidYxhCoA8Ix0jkLiRjilYvxFQv7EBWF5TB2aJMZIyE7gyI4QpMDfoYnGELlZpXYS8kY4xWBhoiym6vCaXJgA "Jelly – Try It Online"