Samsung Electronics just wrote a $26.6 billion check to keep its chip factories running.

The company’s largest labor union ratified a compensation agreement that hands semiconductor workers an average bonus of roughly $340,000 each. In return, Samsung averts what would have been an 18-day general strike involving approximately 48,000 employees across its chip operations.

What the deal looks like

The tentative agreement was reached on May 21, with the ratification vote running from May 22 through May 27. The total bonus pool of about $26.6 billion covers approximately 78,000 workers in Samsung’s Device Solutions chip division.

Here’s the structure: 10.5% of operating profits paid out in company stock, plus an additional 1.5% in cash. The terms are locked in for up to 10 years, contingent on the division hitting certain profit thresholds.