SAN FRANCISCO, CA — Thanks to millions of gamblers whose lucky numbers didn’t come up California school districts are finding a little extra money in their bank accounts.

Distributions from the state lottery during the 2019 fiscal year ended in June were up almost 9% over the previous year, with $1.85 billion being paid to the state’s K-12 school districts, community colleges, and other educational institutions.

San Francisco Unified School District received $12,332,449.36 during the fiscal year 2019, a 7.55 percent increase.

A state lottery spokesperson told news outlets the increase was in large part attributable to the $1.6 billion Mega Millions jackpot in October of last year, the largest jackpot for a numbers game in US history. Four other Mega Millions and Powerball jackpots ranging from $530 million to $768 million also contributed to increased sales and ultimate school district payments.

Preliminary projections show the lottery expects total sales during the fiscal year 2019 to exceed $7.2 billion, with virtually all numbers games and scratcher sales showing increases over the previous year. What’s leftover after prize payments and operating expenses is available for schools.

According to the State Controller’s Office, during the 2018-19 school year $1.45 billion in lottery revenue was distributed to more than 1,200 K-12 school districts and charter schools. Community colleges received $275.1 million and other institutions, including the California State University system, University of California, California Youth Authority, Hastings College of Law and the California Maritime Academy, received $115.9 million.

Since the state lottery was approved by voters in 1984 Californians have anted up more than $36 billion in funding for education by hoping to strike it rich. Nearly $29 billion of this has gone to local school districts.